Skip to main content
Chift runs each flow of a sync on its trigger. You can also start an execution yourself, and pass options to select the period, to export data again, or to test without writing. This page applies to all syncs. New to the model? Read What is a sync? first.

Start an execution

You can start an execution in two ways:
  • From the Platform: open the consumer page and click the play button next to the sync. See Trigger an execution.
  • With the API: call POST /syncs/{syncid}/flows/{flowid}/execute.
Without settings, the flow runs as configured for each consumer. The response returns the chainexecutionid, the resolved_settings and the warnings of the execution.
Chift runs one execution at a time for a flow and a consumer. A request during a running execution returns a 409 with ERROR_EXECUTION_ALREADY_RUNNING.
API reference: Run a flow now ↗

Options

The options are the same for all syncs. Each option controls one thing and does not change the others.
Four cards. Period: two dates, from and to. When empty, the execution goes from the last execution up to today. Synchronised data (import_mode): only what is missing or failed (default), or everything in the period, again. A re-import needs both dates and deletes nothing. Writes (write_mode): write normally (default), write nothing and report only, or write nothing and record a preview. Logs (verbose_logs): detailed logs, off by default. Errors, warnings and information are always logged.

The four common options of a manual execution, with their default values.

force_from_date is the first day of the period. The execution starts from this date instead of the point where the last execution stopped. It ignores the lookback limit of the sync and the start date of the configuration.force_to_date is the last day of the period. The execution stops at this date instead of today.Both dates use the format YYYY-MM-DD. A forced period does not move the cursor of the sync, so the next scheduled execution is not affected.
  • normal (default): the execution exports only the data that is missing or failed.
  • force_reimport: the execution exports everything in the period again, also the data that is already synchronised.
force_reimport needs both force_from_date and force_to_date. Without them, the request returns a 422.A re-import never deletes data in the target software. See Export a period again.
  • normal (default): the execution writes in the target software.
  • debug: the execution writes nothing. It reports what the next real execution would do.
  • preview: the execution writes nothing and records what it would create. It needs both force_from_date and force_to_date. Only the flows that allow previews accept it. See Ledger preview.
The write mode does not change the period or the data that the execution skips.
true adds the debug logs to the execution logs. The default is false. Errors, warnings and information are always logged.
A sync can add its own options. For example, location_ids limits an execution of the POS sync or the PMS sync to some locations.Pass these options in settings, next to the common options. List the options of a flow to find them.

Common cases

These are the requests for the most frequent needs. Each example shows the settings object only.

Import the missing data now

Send no settings. The execution does the same as a scheduled execution: it exports what is missing or failed.

Import a period that was skipped or failed

Pass the two dates of the period. The execution exports only what is missing or failed in this period.

Export a period again

Pass the two dates and force_reimport. The execution exports everything in the period again.
A re-import does not remove the data that the sync already created in the target software. Remove this data in the target software first, or the re-import creates duplicates. First confirm with the end-user that a re-import is safe.

Test without writing

Pass debug. The execution writes nothing and reports what the next real execution would do.

Check a request first

Send the same request with "preflight": true to check it before you run it. Chift checks the request the same way and starts nothing.
  • blocked is true when the same request, sent for real, is refused.
  • warnings lists what you need to know. Each warning has a code, a message and a blocking flag.
A real execution returns the same warnings in its response.

List the options of a flow

Not every sync accepts every option. Call GET /syncs/{syncid}/flows/{flowid}/settings to read the options that a flow accepts.
Use the language query parameter to select the language of the titles and the explanations. The default is English. A request with an option that the flow cannot apply returns a 422 with ERROR_SETTING_NOT_APPLICABLE. The message names the option. For a flow with configurable at false, see Send a custom event for a specific flow (deprecated). API reference: Settings this flow accepts when you run it ↗