Data stream actions
Quick answer
Process large paginated API responses in a flow without running out of memory.
Key takeaways
- Data streams paginate large responses safely
- Use For Each Item to process records one at a time
- Filter at the source rather than in the flow
- Make runs restartable and log volumes
The problem it solves
A REST action returns one payload. When an endpoint has fifty thousand rows across two hundred pages, you need something that streams pages and hands records to the flow one at a time. That is a data stream action.
How it works
The action defines the request, the pagination strategy and the output structure. The flow then uses For Each Item on the stream, processing records without holding everything in memory.
Design notes
Streams still cost time and transactions.
- Filter at the source, never stream everything and discard in the flow
- Handle partial failures, a stream that dies at page 140 should be restartable
- Batch writes where possible instead of one update per record
- Log page counts and record totals so runs are comparable
Want to learn this properly?
Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.
Check your understanding
What consumes the output of a data stream action?
- A. A business rule
- B. For Each Item in the flow
- C. A transform map
- D. A UI action
Show answer
B. For Each Item in the flow
The stream feeds the loop one record at a time.
What is the first optimisation for a large sync?
- A. More MID servers
- B. Filtering at the source API
- C. A bigger instance
- D. Longer timeout
Show answer
B. Filtering at the source API
Not transferring the data is always cheaper than processing it.