Workflow Activities
Activities define the actions that should be taken when certain conditions are met within a workflow. They are executed in the order they are defined.
Activity Structure
Here's a typical example of an Activity section in YAML:
name: "Send Email to the customer"
conditions: # optional
- expression: "[Order.Status] = 'Pick Up'"
description: "Send Email to the customer"
variables: # activity variables
- name: "emailAddress"
value:
switch: "{{ environment }} }}"
cases:
default: " {{ Order.Customer.Email }}"
steps:
- type: "Utilities/HttpRequest@1"
conditions: "[Order.Status] = 'Pick Up'"
inputs:
url: "https://example.com"
method: "POST"
body: '{"order": "{{Order}}"}'
- type: "Email/Send@1"
conditions: "[Order.Status] = 'Pick Up'"
inputs:
to: "{{ emailAddress }}"
template: "OrderConfirmation"
data: '{"order": "{{Order}}"}'
outputs:
- name: "response"
mapping: "{{ sendEmail.response }}"
- name: "statusCode"
mapping: "{{ sendEmail.statusCode }}"
Attributes
-
name(required): The name of the activity. -
conditions(optional): Specifies when the activity should be executed. If not present, the activity will always be executed.Structure:
conditions:- expression: "[Order.Status] = 'Pick Up'" -
description(optional): Provides a human-readable explanation of the activity. -
continueOnError(optional): Specifies whether the workflow should continue if an error occurs during mapping. If not present, the workflow will stop if an error occurs during mapping. -
events(optional): Specifies the events that should trigger this activity. If not present, the activity will be triggered by all events. -
steps(required): Lists the actions that should be taken during this activity. Must have at least one action.Structure:
steps:- task: "taskType@version"conditions: "expression"inputs:key1: "value1"key2: "value2"key3": "{{value1}} {{value2}}" # combined inputoutputs:- name: "output1"- name: "output2"-
task: Specifies the type of action (e.g., "script", "webhook"). Version can be specified after the task name, separated by an@symbol (e.g., "script@1"). Otherwise, the latest version will be used. -
condition(optional): Determines when the action should be executed. If not present, the action will always be executed. -
inputs: Additional information required for the action. -
outputs: The outputs of the action. Outputs used to populate workflowvariablesfield of the next action. If not present, the action will not have any outputs. Names of the outputs are used as keys in thevariablesfield.
-
Utility Import Column Mapping
Utilities/Import@1 accepts optional columnMappings for CSV/XLSX imports. The map uses internal field paths as keys and inbound column headers as values, allowing customer/vendor files to use friendly or external column names without changing downstream workflow expressions.
steps:
- task: "Utilities/Import@1"
name: ImportRows
inputs:
fileUrl: "{{ inputs.fileUrl }}"
format: "csv"
columnMappings:
contact.name: "Customer Name"
contact.emailAddress: "Email"
customValues.externalId: "External ID"
outputs:
- name: rows
mapping: "data?"
The same option is available through entity import flows that delegate to the shared import service.
Utility Export Templates
Utilities/Export@1 accepts optional exportTemplates for computed export columns. The map uses output header names as keys and NCalc expressions as values. Expressions are evaluated against the original row data, so they can combine fields, call functions, or use null-safe nested paths before the flattened export record is written.
steps:
- task: "Utilities/Export@1"
name: ExportOrders
inputs:
name: orders
organizationId: "{{ inputs.organizationId }}"
fileType: Csv
data: "{{ Data?.GetOrders?.orders? }}"
headers:
- orderNumber
- firstContainer
columnMappings:
orderNumber: "Order #"
firstContainer: "First Container"
exportTemplates:
firstContainer: "oceanShipments?[0]?.containerNumber?"
outputs:
- name: fileUrl
mapping: "fileUrl?"