MID Server support for Data Stream actions
Summarize
Summary of MID Server support for Data Stream actions
ServiceNow MID Server can be used to retrieve data during Data Stream actions by running the data retrieval process on the MID Server, which then sends each page of data to the instance as an attachment for processing. This enables integration with external systems or data sources while leveraging the MID Server’s capabilities.
Show less
When running Data Stream actions within a flow, all actions inside a For Each block execute on the instance. Some steps, including Action Preprocessing Script, Request Script, and REST or SOAP steps, can run either on the MID Server or on the instance, depending on configuration.
Best Practices and Execution Considerations
- Avoid switching execution frequently between the MID Server and the instance within the same Data Stream action, as this can degrade performance. For example, running the Request Script step on the MID Server and the REST step on the instance causes environment shifts per data page.
- For guidance on running integration steps on the MID Server, refer to the Integration steps documentation.
Handling Size Limits and Timeouts
If you encounter timeouts or size limitations when using Data Stream actions with the MID Server, consider the following adjustments:
- REST transaction quota: Increase the REST Attachment API request timeout (default 60s, max 300s) to handle slower connections.
- Instance timeout: Adjust the
datastreamalternativeenvfetchpagetimeoutsecondssystem property (default 600s, max 7200s) to allow more time for the instance to retrieve data pages. - Attachment size: Increase the maximum allowed size for attachments by updating the
com.glide.attachment.maxsizesystem property (default 1024 MB, no maximum) to accommodate large data pages sent from the MID Server.
JDBC Operations and Timeout Settings
For JDBC-based Data Stream actions, it is recommended to execute the action asynchronously and poll the Attachments [sysattachment] table for results. The MID Server processes the SQL queries, while the instance waits for data payloads to be inserted as attachments before querying for subsequent records.
You can configure the following timeout properties for JDBC operations:
com.snc.processflow.datastream.payload.timeout.seconds: Time the instance waits for payload availability from MID Server JDBC execution. Default is 600 seconds; range 0–7200 seconds.com.snc.processflow.datastream.asyncchild.timeout.seconds: Time allocated for execution of a child plan on the MID Server. Default is 60 seconds; range 0–7200 seconds.
Get data through a ServiceNow® MID Server when running a Data Stream action.
When selected, the MID Server retrieves the data and sends each page to the instance as an attachment to process.
These steps can run on either the MID Server or the instance:
- Action Preprocessing Script
- Request Script step
- REST or SOAP step
To learn more about running a step on a MID Server, see Integration steps.
Size limits
If your system encounters a timeout or size limit issue, try making one of these adjustments:
- Increase the REST transaction quota rule
If the connection between the instance and the MID Server slows down, you may encounter a timeout while waiting for a response from the REST step. Increase the default timeout by updating the REST Attachment API request timeout transaction quota rule.
- Default: 60 seconds
- Maximum: 300 seconds
- Increase the instance timeout
By default, the instance waits for 600 seconds to retrieve a single page of data from a MID Server. If you encounter a timeout when running a Data Stream action through a MID Server, change this default by increasing the datastream_alternative_env_fetch_page_timeout_seconds system property.
- Default: 600 seconds
- Maximum: 7200 seconds
- Increase attachment size
- The MID Server sends each page of data to the instance as an attachment. If
a page of data is large, it may exceed the allowed attachment size. Increase the allowed size
by updating the com.glide.attachment.max_size system property.
- Default: 1024 MB
- Maximum: None
JDBC operations and MID Server timeouts
For JDBC operations, execute the Data Stream Action asynchronously and poll the Attachments [sys_attachment] table for results.
The MID Server processes the SQL statement, while the instance/main thread waits for context payloads to be inserted into the attachment table to query the next record.
You can adjust timeout values for JDBC operations with the following properties.
- com.snc.process_flow.datastream.payload.timeout.seconds
- The amount of time the instance waits for the payload to be available from the JDBC execution in the MID Server. A bounded property with a minimum value of 0 seconds and a maximum value of 7200 seconds. The default time is 600 seconds.
- com.snc.process_flow.datastream.async_child.timeout.seconds
- The amount of time allocated for the execution of a child plan in the MID Server.A bounded property with a minimum value of 0 seconds and a maximum value of 7200 seconds. The default time is 60 seconds.