Poll Executions
This endpoint is used to regularly poll for new executions that have been processed by Stedi.
You must define one of startDateTime
or pageToken
when making a request.
You may optionally define a pageSize
. The minimum pageSize
is 1, and the maximum pageSize
is 1000. The default is 100.
startDateTime
takes a string in ISO 8601 format. (ex: 2023-08-10T18:00:00Z
).
startDateTime
must be set to at least 1 minute in the past.
The results will contain executions that occurred after this startDateTime
. Starting from the oldest to newest executions ordered by the processedAt
field. Note, this is exclusive of the startDateTime
, a execution occuring at exactly 2023-08-10T18:00:00Z
for instance, would not be included. In addition, there is a 15 second window where newly created executions will not be included to account for any network latency or clock drifts within the systems to ensure you do not miss any executions.
Each request will always return a nextPageToken
, regardless of whether there are new executions or not.
We DO NOT recommend trying to roll your own polling strategy leveraging startDateTime
only. There are edge cases around two executions occuring at the exact same time and being on the edge of a pagination which could cause you to miss one due to the exclusive nature of startDateTime
. We recommend using pageToken
’s instead.
When making subsequent polling requests (not initiating with startDateTime
), the pageToken
can be used to continue iterating through pages of executions. Usage of the pageToken
guaruntees you will not miss any executions on the stream. If at any point there are no more new executions in the item
array, you will still receive a nextPageToken
. Continue to use this token to poll for new executions. Once there are new executions, they will be returned in the item
array.
pageToken
’s you have retrieved can serve as checkpoints. They do not expire, and you can always start from that point in the execution stream again if you need to catch a system up or recover from a failure. Storing pageToken
’s as part of your polling process is encouraged.
pageToken
’s are unique per request, opaque, and should not be parsed or modified in any way. They are not guaranteed to be in any particular format, and may change in the future.
This endpoint returns file executions that Stedi processed after the specified startDateTime
.
Executions are ordered from oldest to newest according to the processedAt
property. This is exclusive of the startDateTime
. For example, if the provided startDateTime is 2023-08-10T18:00:00Z
, an execution processed at exactly that time would not be included in the results. There is also a fifteen-second window where newly created executions are excluded, meaning Stedi returns results up to fifteen seconds before the time of your request. This functionality accounts for any network latency or clock drift within the systems to ensure you don’t miss any executions.
Polling with page tokens
We don’t recommend polling using startDateTime
only. Due to the exclusive nature of startDateTime
, you could potentially miss an execution if two executions occur at the exact same time and are on the edge of a pagination. Instead, you should use pageToken
.
After the initial request, you can poll again immediately using pageToken
to continue iterating through the pages of executions. The endpoint always returns a nextPageToken
, regardless of whether additional executions match the request criteria. If the items
array is empty, continue using the provided nextPageToken
to poll for new executions. New executions will be returned when available.
We recommend storing pageToken
values as part of your polling process. They don’t expire, allowing you to start from that point in the execution stream again if you need to catch a system up to date or recover from a failure.
Note that pageToken
values are unique per request, opaque, and shouldn’t be parsed or modified in any way. They are not guaranteed to be in any particular format, and may change in the future.
Authorizations
A Stedi API Key for authentication.
Query Parameters
The maximum number of elements to return in a page. You can set this to a maximum of 500 elements. If not specified, the default is 100.
x >= 1
A token returned by a previous call to this operation in the nextPageToken
. If not specified, Stedi returns the first page of results.
1 - 1024
An ISO 8601 formatted string. For example 2023-08-28T00:00:00Z
. Stedi returns executions processed after this time.