← Back to blog

SAP OData pagination in n8n: bound and reconcile Business One orders

Plan SAP OData pagination for Business One 10.0 Orders: inspect next links, bound requests and check counts before releasing records downstream.

SAP OData pagination shown as order sheets passing through a stop gate toward a reconciliation balance.

Checked against the cited sources on .

Define the SAP OData pagination goal and prerequisites

A service cabinet, keyring and notebook represent prerequisites for Business One Orders extraction.
Begin with an identified deployment and authenticated access.

This tutorial scopes SAP OData pagination to read-only Orders extraction from an existing SAP Business One 10.0 Service Layer deployment. The goal is to follow continuation links within explicit request bounds, then check rows and document keys before downstream processing. The supplied documentation supports the individual controls, but not a complete runnable workflow across authentication, relative-link resolution, completion settings and downstream blocking; those details require deployment-specific verification.

Record your actual Business One patch level, hosting arrangement, Service Layer endpoint and n8n HTTP Request node version. SAP's Business One 10.0 reference identifies OData V3 as deprecated from FP 2405 and retains OData V4 guidance. SAP demonstrates Orders retrieval through /b1s/v2/Orders.

Start with an approved, authenticated read already working in n8n. SAP documents HTTPS and session continuity through SessionID and ROUTEID cookies; n8n requires the authentication method expected by the target service. This tutorial assumes that continuity is already established for successive requests.

Sources: Service Layer API Reference, Logging In and Out Using Basic Authentication with Service Layer, n8n-docs/docs/integrations/builtin/credentials/httprequest.md at main · n8n-io/n8n-docs · GitHub, Exploring Various Data Retrieval Options Using GET request

Choose the query and inspect one Orders response

Matching filter stencils cover order records and count tokens for the extraction query.
Use the same filter for the Orders extraction and its source count.

For this SAP OData pagination example, use an editorial extraction contract: one approved Orders filter, DocEntry plus the fields needed downstream, ordering by DocEntry, and a separate count request with the identical filter. SAP documents $select, $orderby and collection counts through /Orders/$count.

Follow these preparation steps before enabling repeated requests. DocEntry is identified as a unique document key in SAP Business One 10.0 DI API documentation; SAP's Service Layer lesson separately demonstrates addressing an order by that key. Confirm its presence in your actual Orders response.

  1. Write down the extraction filter and reuse it unchanged for the data and count requests.
  2. Select DocEntry and the required downstream fields; order the extraction by DocEntry.
  3. Fetch one approved Orders page and inspect its value array and continuation annotation.
  4. Record the matching source count and the observed response shape for reconciliation.

Inspect the continuation annotation rather than copying its spelling from an example. SAP's protocol-specific guidance names @odata.nextLink for V4 and odata.nextLink for V3, while its retrieval lesson uses inconsistent terminology. We think inspecting the returned payload is a better starting point than adapting a familiar pagination template.

Sources: Exploring Various Data Retrieval Options Using GET request, Paginate the Selected Orders | SAP Help Portal, Query Options | SAP Help Portal, Documents Object Members - SAP B1 SDK Help

Configure bounded next-link pagination

Page bundles and continuation ribbons meet a stop block beside an hourglass for bounded pagination.
A request ceiling bounds work even when another page remains.

In HTTP Request, enable Pagination and choose Response Contains Next URL. Supply a Next URL expression that reads the continuation field observed in your response. Preserve the server-provided continuation query parameters. If the link is relative, verify its resolution against your deployment before proceeding; the supplied documentation does not establish handling for both root-relative and service-relative links.

For a populated final page without a continuation annotation, n8n's reference recommends custom completion based on that field being absent. The same reference gives conflicting guidance about automatic termination on falsy next URLs. Verify the completion setting in your installed node version rather than treating an empty next URL as sufficient.

Set explicit bounds using the controls below. Choose their values with the SAP service owner. Our practical preference is to stop and investigate a capped run rather than release its partial output.

Documented request controls and their limits
ControlPurposeLimit
limitPagesFetched and maxRequestsEnable a hard request capDoes not prove completion
requestIntervalDelay between requestsNot documented as a completion check
TimeoutBound waiting for response headersNot a total workflow deadline

Preserve page-level evidence before splitting: whether a continuation remains, which continuation values were seen, and whether the configured ceiling was reached.

Sources: Paginate the Selected Orders | SAP Help Portal, n8n-docs/docs/build/code-in-n8n/cookbook/http-request-node/pagination.md at main · n8n-io/n8n-docs · GitHub, skills/skills/n8n-loops-official/references/HTTP_PAGINATION.md at main · n8n-io/skills · GitHub, HTTP Request | Nodes | n8n Docs

Reconcile orders and troubleshoot before release

Record slips, unique key tokens and count beads sit before a release gate for order reconciliation.
Compare rows, unique keys and the matching source count before releasing orders.

After preserving pagination evidence, use Split Out with Field to Split Out set to value to separate each page's order array. Wrapped responses need this explicit handling. n8n's Code node supports JavaScript and Run Once for All Items, making it a possible location for custom reconciliation logic; the supplied documentation does not establish the complete collection, empty-result and blocking implementation.

Use this suggested editorial acceptance rule for SAP OData paging: release only when pagination completed, every row has DocEntry, retrieved rows equal distinct DocEntry values, and both equal the matching source count. Matching these checks does not establish a transactionally consistent snapshot. We regard reconciliation as a release condition, not a completeness guarantee.

The following are suggested troubleshooting checks, not tested outcomes. For an empty extraction, require explicit pagination completion and a matching zero source count before accepting it.

Sources: Paginate the Selected Orders | SAP Help Portal, Query Options | SAP Help Portal, skills/skills/n8n-loops-official/references/HTTP_PAGINATION.md at main · n8n-io/skills · GitHub, n8n-docs/docs/integrations/builtin/core-nodes/n8n-nodes-base.splitout.md at main · n8n-io/n8n-docs · GitHub, Documents Object Members - SAP B1 SDK Help, Using the Code node | Build | n8n Docs

Put this into practice

Hands-on n8n challenges

Pick a challenge and build a working workflow in your own n8n environment, with five progressive tips per challenge.

Try a hands-on challenge

For your team

Custom n8n training programs for one team or department, run on your own n8n instance with your own tools and data.

Training for your team

n8n skills assessment

A free quiz of about 20 minutes: 30 questions in 10 skill areas and a level from Beginner to Expert. On AI Adoption Score, another project by the author of this site.

Get your n8n level