Articles in this section

Use an async helper for asynchronous APIs

Some APIs don't answer a request with the result. They accept the request, start a job, and expect you to ask whether the job is done and then fetch the result separately — Amazon's feed and report APIs work this way, as do many bulk endpoints. An async helper is the integrator.io resource that handles that conversation for an export or import: it waits, polls the API for status, recognizes done and failed states from values you specify, and retrieves the result when the job completes. This article explains where an async helper can be used, how to create one, and what each of its settings means.

How an asynchronous API works

  1. integrator.io sends the request — a report request, a bulk upload, a query.
  2. The API responds that the job has started, usually with an ID.
  3. integrator.io checks the job's status at the interval you set.
  4. The API reports the job as in progress until it finishes.
  5. When the API reports the job as done, integrator.io retrieves the result and the flow continues.

Where you can use an async helper

An async helper works on a flow's source export and on an import. It isn't supported on a lookup step: a flow with an async helper on a lookup can't be saved or enabled, and Flow builder reports Invalid flow - async export <name> of type cannot be used as a pageProcessor. Instead:

  • make the asynchronous call the flow's source export;
  • if the step only has to submit a request and wait for it to finish, use an import with an async helper; or
  • split the work into two flows, and start the second flow from the asynchronous export with Run next flow; see Configure flow settings.

A test run doesn't execute an export that has an async helper; the flow reports The flow in the test mode is not supported for asynchronous export. Run the flow instead; see Run a flow. The same rule applies to Storage Query exports; see Query Celigo Storage from a flow with an async helper.

An export with an async helper can't have a transformation, an output filter, or a pre-save page hook. Put them on the result export instead — the export the helper uses to retrieve the finished job — and select that export in Result export.

Create an async helper

An async helper needs two exports to exist already: one that checks the job's status and one that retrieves the result. Create them first, against the same connection as the step; see Create an export.

  1. Go to Build build-icon.png > Flows, open the flow, and then select the export or import step to open its editor.
  2. Expand Advanced, and then turn on Configure async helper. The setting appears on exports and imports whose connector supports it, such as HTTP.
  3. In Async helper, select an existing helper, or select + add-round-button.png to create one. To change the selected helper, select Edit edit-button.png.
  4. In Create async helper, complete the settings described in Async helper settings, and then select Save & close.
  5. Select Save & close on the step.

An async helper used by more than one flow shows a Proceed with caution banner when you open it; select Used by to see every flow that depends on it before you change it.

Async helper settings

Setting Required What it does
Name Yes Identifies the helper when you select it on other steps.
Status export Yes The export that asks the API whether the job is done.
Initial wait time No Minutes to wait before the first status check. Enter 2 to wait two minutes after the job starts.
Poll wait time No Minutes between status checks. Enter 2 to check every two minutes until the job is done.
Status path Yes The JSON or XML path in the status export's response where the job state appears — for example, FeedProcessingStatus.
In progress values Yes The values at the status path that mean the job is still running — for example, SUBMIT, IN PROGRESS for Amazon. Case-sensitive; separate several values with commas. Check the API's documentation for the values it returns.
Done values Yes The values that mean the job finished — for example, DONE.
Done without data values No The values that mean the job finished but produced no data, so there's nothing to retrieve.
Error values No The values that mean the job failed — for example, CANCELED, ERROR. Case-sensitive; comma-separated.
Result export Yes The export that retrieves the finished job's result. Transformations, output filters, and pre-save page hooks for the data go on this export.
Same as check status No On by default. Leave it on when the API's first response has the same shape as its status responses; turn it off to describe the first response separately.
Resource path When Same as check status is off The path to the data in the first response. Handlebars expressions can reference anything returned in the status and result messages.
Transform rules No Rules that convert a non-JSON first response to JSON — an XML response from Amazon, for example. See Transform data in integrator.io.