A Data Stream action pulls a large or paginated response from a REST, SOAP or JDBC source into a flow. For REST and SOAP sources, it requests one page at a time and splits each page into items. Child actions then run for each item inside a For Each block. An Integration Hub subscription is required.
When a Data Stream action is the right tool
Use a Data Stream action when a stream grows past 10 MB, or when a source returns results in pages and the flow has to keep asking for the next page until the source runs out of data.
For example, a flow that loads employee records from an HR platform into the User [sys_user] table, where the HR API returns them one page at a time.
Licensing and transaction counting
Data Stream actions require an Integration Hub subscription. For licensing purposes, each request counts as one transaction, and that includes each request for the next page of results. A stream that pulls 50 pages therefore counts as 50 transactions, not one.
The three sections of a Data Stream action
A Data Stream action is built from three sections. Each section runs at a different point in the stream, and each has its own rules.
| Section | How often it runs | What it contains | Restrictions |
|---|---|---|---|
| Action preprocessing | Once, before the first API request | An optional Get Connection Info step and an optional preprocessing script | Cannot call a MID Server or pause the action |
| Request | Once per page of results for REST or SOAP; a JDBC step runs once, with no pagination | One REST, SOAP or JDBC step, with an optional pagination setup and pagination script | Pagination does not apply to the JDBC step |
| Parsing | Applied to the items in each page | A JSON or XML splitter and a script parser | The splitter is not used for JDBC |
Clearing an option on a configuration page removes that step from the outline and deletes the data associated with it, so a change to one option can remove more than the option itself.
Action preprocessing
Preprocessing is optional, and its script runs once, before the first API request. The script must not call a MID Server or pause the action for a condition or a duration. A script that does either returns an error.
Request
The request section sends one REST, SOAP or JDBC request for each page. The REST or SOAP step, and the preprocessing and request scripts, can run on either a MID Server or the instance, depending on configuration. Switching the execution environment between the instance and a MID Server on every page can degrade performance. For the general patterns behind these calls, see REST and SOAP integrations in ServiceNow.
A script can run before each paginated request to update the pagination variables for that request.
Parsing
For REST and SOAP actions, the parsing section holds a splitter and a script parser. The splitter is a JSON or XML splitter that picks out the repeated items in the response. The script parser maps the fields of each item onto an output object. The output is a complex Object, and you add child fields to match the data you map.
Pagination and the getNextPage variable
Pagination variables set starting values, and those starting values apply only to the first request. Later values come from the Next Value From setting, which is either a script or a response body. A response body value is read with a JSONPath or XPath expression.
Pagination variables are strings. Any arithmetic on an offset or page number needs a conversion first: convert the value to an integer, calculate the new value, and convert it back to a string before the next request.
The pagination setup can be built by hand or from a template. The Limit / Offset template sets the number of items returned per page as the limit, and the starting number for the first item as the offset.
The getNextPage variable controls the loop. It is a reserved, read-only Boolean. While it stays true and the previous page contains data, the action keeps requesting pages. It defaults to false, so the stream stops after the first page unless the script sets it to true explicitly.
A script should also set getNextPage to false at a defined end point. Without that condition, the stream can run indefinitely when the source keeps returning data.
Where the steps run: MID Server rules
Within a flow, actions in a For Each block run on the instance. JDBC, PowerShell and SSH steps always run on a MID Server, so they cannot be placed inside a Data Stream For Each block, where they would pause or disrupt the stream.
The JDBC step is different because it is the request step of a JDBC data stream. In that case it runs on a MID Server as part of the action itself.
When a REST or SOAP step runs on a MID Server, the MID Server retrieves the data and sends each page to the instance as an attachment.
JDBC data streams
A JDBC Data Stream action does not use pagination. The single JDBC step retrieves the data for the stream, and the action runs asynchronously. The flow then has to poll the Attachments table to find the output. Two timeout properties control how long the instance waits for that output. For the import-set side of JDBC sources, see the import-set data source types page.
| Property | Default | Range |
|---|---|---|
| com.snc.process_flow.datastream.payload.timeout.seconds | 600 seconds | 0 to 7200 seconds |
| com.snc.process_flow.datastream.async_child.timeout.seconds | 60 seconds | 0 to 7200 seconds |
A JDBC page can hold up to 1 GB, and a single request can retrieve up to 8 GB.
Page size and attachment limits
Keep each page under 1 GB. Larger pages can run into size limits when the MID Server passes them to the instance, and the flow designer may need to raise the attachment size limit before the stream runs.
| Limit | Default | Maximum |
|---|---|---|
| Attachment size, com.glide.attachment.max_size | 1024 MB | No maximum |
| REST Attachment API request timeout | 60 seconds | 300 seconds |
| Instance wait for a single page from the MID Server | 600 seconds | 7200 seconds |
Retries and the 30-second cap
Retries use the fixed interval strategy. The total delay, meaning the retry count multiplied by the interval, cannot exceed 30 seconds. Five retries at 6 seconds each fits within the limit, while five retries at 10 seconds does not.
Execution reporting
By default, the execution details include requests for the last 1000 items and for the last five pages. Each default can be changed with a system property.
| Property | Default | What it controls |
|---|---|---|
| com.snc.process_flow.reporting.datastream.item.lastn | Last 1000 items | Number of items kept in the execution details |
| com.snc.process_flow.page.reporting.lastn | Last five pages | 0 removes page details; -1 keeps all pages |
Keeping all pages can affect performance and is not recommended. For large record sets inside a For Each block, reporting should be turned off with the reporting level property, com.snc.process_flow.reporting.level.
What can sit inside the For Each block
Ask for Approval and Wait for Condition always pause a flow, so neither can be used inside Data Stream For Each logic. Create Task and Create Catalog Task may pause depending on configuration, so check each one before placing it inside the loop. Nesting Data Stream actions is not supported.
Approval steps hit this limit directly, because Ask for Approval always pauses a flow. A practical pattern is to have the stream write records, then trigger a separate flow or subflow that contains the approval step and runs once for each record. This is a design choice rather than a product rule, so test the handoff between the two flows.
Building a Data Stream action
Before you start, set up an application in Guided Application Creator to store the Workflow Studio content, and disable any conflicting business rules or workflows.
Submit the action properties form to open an empty action, then work through these steps.
- Create inputs for any values the API needs, such as credentials or identifiers. Inputs appear as data pills in the right-hand pane.
- Configure action preprocessing, adding a preprocessing script if the action needs to validate inputs or set defaults.
- Configure the request by choosing a REST, SOAP or JDBC step. Enable pagination if the API returns results in pages.
- Configure the pagination setup manually or from a template such as Limit / Offset, and add the script that runs before each paginated request.
- Configure parsing with a JSON or XML splitter and a script parser. For JDBC, test the step, click Use Result, and optionally add a Transform script.
- Create a complex Object output and add the child fields that match the data you map.
- Save the action. Workflow Studio saves a draft, so test the action before any production use.
Is an Integration Hub Data Stream action the same as Kafka streaming, and which one fits a large or paginated API response?
No. A Data Stream action works through a REST, SOAP or JDBC source that returns data in pages or in one large response, handing each item to child actions. Kafka Stream Connect is a separate event-streaming capability with its own entitlement. For large or paginated API responses, a Data Stream action is usually the right fit.
How the two capabilities differ
- The data source. A Data Stream action asks a source for records it already holds, such as a paged REST or SOAP endpoint or a JDBC query. Kafka Stream Connect exchanges event streams, so its input is a flow of events rather than a stored result set.
- The timing. Requests run page by page inside one bounded run, so the stop condition has to be set deliberately. Kafka Stream Connect fits continuous event ingestion or publication, which is a different requirement from a bounded import.
- The entitlement. Data Stream actions draw on Integration Hub, and Kafka Stream Connect carries its own entitlement and setup. As of November 2026, the Workflow Data Fabric Foundation legal overview, effective 28 September 2026, includes Integration Hub Enterprise. The Advanced package also adds Kafka Stream Connect, so confirm that scope against the order form.
Choosing between them for a large or paginated response
- Confirm the direction of data. If the flow asks the API for records, a Data Stream action is the candidate. If the source pushes events as they happen, evaluate Kafka Stream Connect separately.
- Check how the API pages its results. The pattern works when the next starting point can be read from the response or calculated by a script. An API with no page marker and no stable ordering needs a design decision before the build starts.
- Measure one real page. As of November 2026, the pattern supports responses exceeding 10 MB. A sample page from the live endpoint shows whether the pull is large enough, or paged enough, to justify it.
- Estimate the request load. Size the load before go-live: multiply the pages in one full pull by the number of runs per day.
- Confirm the entitlement before design starts. Check the package named on the existing contract. Older agreements can use different package names. A requirement for Kafka Stream Connect cannot be met by the Data Stream entitlement alone.
Questions to ask before you commit
- Does the source return the full record set on every run, or only the changes since the last run?
- If a run fails partway through the pages, how will the flow avoid loading the same record twice?
- Does the business need each record once in a scheduled import, or does it need to act on every event as it happens?
- Which Integration Hub entitlement covers the instance, and does the Kafka Stream Connect requirement appear anywhere in the order?
Frequently asked questions
What is a Data Stream action used for?
It pulls a large response, or a response that comes back in pages, from a REST, SOAP or JDBC source and passes each item to the child actions inside a For Each block.
Does a Data Stream action need a separate license?
It requires an Integration Hub subscription. Each request, including each request for the next page, counts as one transaction.
Can I place an approval step inside a Data Stream loop?
No. Ask for Approval and Wait for Condition always pause a flow, so they cannot be used inside Data Stream For Each logic. Move the approval into a separate flow or subflow that runs for each record.
Why does my stream stop after the first page?
The getNextPage variable defaults to false, so the script has to set it to true while more pages are expected.
Can Data Stream actions be nested?
No. Nesting Data Stream actions is not supported.