Workflow conditions
Explore how to add conditions to your workflows.
All workflows have conditions. Conditions are used to provide action execution when they are met. You can customize conditions to be processed with certain data.
Root conditions
Actioner processes every data
- received from an endpoint of a webhook workflow and
- received from a Slack event through a Slack workflow and
- received from a HubSpot event through a HubSpot workflow.
The data is evaluated against the workflow's conditions. If conditions are met, Actioner executes the steps added to a workflow and ends the processing. If conditions are not satisfied, nothing happens.
The conditions in the above image are set to One or more conditions below.
If the variable {{event.body.status}}
equals to New
or Open
, then the steps will be executed and the processing will end there.
If, however, {{event.body.status}}
equals to something other than New
or Open
, it will be evaluated against the workflow's root conditions and its steps will not be executed.
Condition types
- All events: When selected, the workflow will match every data that's evaluated against it and proceed to executing its steps. No specific condition is specified when this option is selected.
- One or more conditions below: When selected, if any one of the conditions are satisfied, it's sufficient to proceed to executing the steps.
- All conditions below: When selected, if all of the conditions are satisfied, it's sufficient to proceed to executing the steps. If any of them fails, steps will not be executed.
These 3 boxes denote in order:
- The variable to evaluate, typically a dynamic data referencing a key in the received payload, such as
{{event.body.status}}
. - The functional operation that the variable is expected to comply.
- The value that the variable is expected to match.
To add a new condition, click + Add condition button.
To remove a filter click X right near it.
Your changes are applied after you save your changes.
In Slack workflows, filters on the left-hand side are pre-set. You can set dynamic values on freeform fields that are on the right-hand side of the filter.
In webhook and HubSpot workflows, you can use dynamic values on both sides.
Dynamic filters with event payload data
An event payload is the information carried in the headers and body of the trigger event. It is a JSON object and is referenced with event
.
- If the workflow type is webhook, event payload is JSON data sent to that particular webhook.
- If the workflow type is Slack, event payload is the JSON data captured by Actioner as a result of the selected Slack event. Visit this page to see example payloads Actioner captures for different Slack events.
- If the workflow type is HubSpot, event payload is JSON the data captured by Actioner as a result of the selected HubSpot event. Visit this page to see example payloads Actioner captures for different HubSpot events.
In a workflow, you can reference to event data with {{event}}
notation. As you type event
inside curlies, Actioner autocompletes you with next available fields or properties.
Reference to data in the body of the event with {{event.body}}
and reference to the data in the headers of the event with {{event.headers}}
{{event.body.status}}
equals to New
in the below event payload:
Dynamic filters with your app's store
Store is a JSON object that stores and persists the states of data on app level and is referenced with store
. Data added to app storage can be re-used by any future executions of actions and workflows in that app.
To retrieve the value of a key from store, use {{store.get('key')}}
inside curlies in a root condition field.
Step conditions
You can add additional for each workflow's steps. That particular step is executed as long as conditions
- Root conditions are satisfied AND
- Step conditions are satisfied AND
- Earlier steps -if there are any- did run successfully.
Once the root conditions of a workflow is satisfied, workflow starts processing the steps in top down order.
To decide whether to run the step or not, data is also checked against the conditions of that step.
If step filters are satisfied, Actioner executes the selected action and proceeds to next step. If conditions are not satisfied, Actioner does not execute the selected step. But processing does not stop.
Processing stops when an action added to an earlier step could not be successfully run or when the last step of the workflow is evaluated.
Dynamic filters with event payload data
An event payload is the information carried in the headers and body of the trigger event. It is a JSON object and is referenced with event
.
- If the workflow type is webhook, event payload is JSON data sent to that particular webhook.
- If the workflow type is Slack, event payload is the JSON data captured by Actioner as a result of the selected Slack event. Visit this page to see example payloads Actioner captures for different Slack events.
- If the workflow type is HubSpot, event payload is JSON the data captured by Actioner as a result of the selected HubSpot event. Visit this page to see example payloads Actioner captures for different HubSpot events.
In a step condition field, you can reference to event data with {{event}}
notation. As you type event
inside curlies, Actioner autocompletes you with next available fields or properties.
Reference to data in the body of the event with {{event.body}}
and reference to the data in the headers of the event with {{event.headers}}
{{event.deal.properties.dealStage}}
does not equal to appointmentscheduled
in the below event payload:
Dynamic filters with your app's store
Store is a JSON object that stores and persists the states of data on app level and is referenced with store
. Data added to app storage can be re-used by any future executions of actions and workflows in that app.
To retrieve the value of a key from store, use {{store.get('key')}}
inside curlies in a step condition field.
Dynamic filters with an earlier action's context
Context
Context is a JSON object that stores the states of data at action execution. It is produced when an action is run --either by a workflow or run manually.
If it is run by a workflow automatically, context is built incrementally through each step of the workflow and is destroyed when the workflow runs the last step.
The data of an action's context can be accessed
- by that action's components
- by the later steps processed by the same workflow.
Accesing an action's context in a workflow
When you want to conditionally run an action depending on the result of an action executed in an earlier step, you can reference that action's context.
context.get('key')
returns the value of the key
from the context of the action that is executed in an earlier step.
Use {{context.get('key')}}
inside curlies in your workflow's step conditions, to build a dynamic filter with this key,
You can reference to an action's context, if that action is successfully executed in an earlier step of the same workflow.
For example, if you try to get a value in the first step of a workflow, it would not work since the context has not been created at that point.
Context is created with the successful execution of the first matching action in a workflow. Each executed step can continue to add data to context incrementally. Context is destroyed when the workflow runs the last step.
Functional operations
- equals: Applicable for String, Boolean and Number variable types. It returns true if the specified variable's value and the expected value are the same.
- does not equal: Applicable for String, Boolean and Number variable types. It returns true if the specified variable's value and the expected value are not the same.
- contains: Applicable for String variable types. It returns true if the specified variable's value contains the expected string.
- does not contain: Applicable for String variable types. It returns true if the specified variable's value does not contain the expected string.
- starts with: Applicable for String variable types. It returns true if the specified variable starts with the expected value.
- does not start with: Applicable for String variable types. It returns true if the specified variable does not start with the expected value.
- ends with: Applicable for String variable types. It returns true if the specified variable ends with the expected value.
- does not end with: Applicable for String variable types. It returns true if the specified variable does not end with the expected value.
- is empty: Applicable for String and Array variable types. It returns true if the specified variable is empty. For string, it checks character count. For arrays, it checks array length.
- is not empty: Applicable for String and Array variable types. It returns true if the specified variable is not empty. For string, it checks character count. For arrays, it checks array length.
- is one of: Applicable for String, Object, Boolean and Number variable types. It returns true if the variable is an element of the specified array.
- is not one of: Applicable for String, Object, Boolean and Number variable types. It returns true if the variable is not an element of the specified array.