With Workflows, users can orchestrate the flow and transformation of business documents between various systems or trading partners.
Workflows are composed of individual actions that are combined to execute a process (e.g. receiving a Purchase Order and submitting it to an API endpoint). Each action within a workflow performs a specific process step, such as leveraging a custom function to reshape the Purchase Order format. Each time a workflow is triggered, the outcome is recorded via an execution. Successful executions highlight that all actions within the workflow succeeded, while failed executions highlight the specific action within the workflow that was unsuccessful. Failed executions are logged as errors to simplify the debugging process.
To create a workflow, navigate to the
Workflows tab in Terminal.
After navigating to the
Workflows tab, click
Create a workflow. Users will then configure the workflow's trigger and action(s).
Configure a Workflow trigger:
A Workflow is triggered via an API call to the Workflow start execution endpoint. By default, all Workflows can be started by an API call. For example, a Shopify user getting a new sales order could send a webhook to the Workflow URL to post the sales order payload and initiate the Workflow.
Configure Workflow Actions:
After a trigger initiates the workflow, the document is processed by each action in the workflow. To create an action, click
Add action. Users can select from four preconfigured actions:
- HTTP: Define a set of request methods for a given resource.
- EDI to JSON: Convert EDI documents into JSON documents.
- JSON to EDI: Convert JSON documents into EDI documents.
- Function: Write custom business logic to accomplish tasks not covered by other actions.
After users have configured all of their required actions, the workflow can be turned on via the
After a workflow is enabled, it will run every time the trigger is fired. Each instance of a workflow running will generate an execution. An execution is an immutable record of the workflow instance, such as submitting a specific Purchase Order to an API endpoint.
Users can see the status of an execution in the Executions tab.
Any execution that fails during a workflow will result in an error. The root cause and location of the error (failed action) within the workflow will be highlighted in red. To take an action on the error, users can either:
- Resolve, which acknowledges the error without taking any further action. This is ideal for ignoring an execution that has been resolved downstream.
- Retry and Resolve, which initiates a second version of the same execution in the failed workflow. This is ideal for retrying the execution after the underlying issue has been remedied and the execution must be reprocessed.