Workflows
Because of the complexity of Workflows, the endpoint does not allow for Create functionality, but it will allow you to Retrieve, Update, and Delete workflows. The following actions can be performed on this resource...
- Retrieve All Workflows
- Retrieve a Specific Workflow
- Edit a Specific Workflow
- Delete a Specific Workflow
Workflow Entry Rules
Workflows support four different entry rule options that control how often contacts can enter a workflow:
- once - Contact can only enter the workflow one time ever
- oneAtTime - Contact can enter multiple times, but only if they're not currently in the workflow
- onceInTime - Contact can only enter once within a specified time window (requires entry_rule_time_value and entry_rule_time_unit)
- multiple - Contact can enter the workflow multiple times with no restrictions
Retrieve All Workflows
Retrieves all workflows associated with a specific brand.
You can include additional parameters in the request as described in the Query Parameters section. For instance, the request below will return only inactive workflows.
Example Response:
{
"data": [
{
"workflow_id": 444444,
"_brand_id": 123456789,
"name": "Gather First and Last Name",
"description": "Will kick off when contact is created.",
"entry_rule": "oneAtTime",
"entry_rule_time_value": null,
"entry_rule_time_unit": null,
"active": 0,
"created": "2024-11-13 02:41:43",
"last_updated": "2024-11-20 17:38:34",
"last_activated": "2024-11-13 02:41:43",
"last_deactivated": "2024-11-20 17:38:34",
"last_cleared": null
}
],
"pagingData": {
"prevPage": null,
"currentPage": null,
"nextPage": null,
"currentPageString": null,
"hasMore": false
}
}
Retrieve a Specific Workflow
Retrieves a single workflow with the Workflow ID equal to {id}. The Workflow ID can be found using the retrieve all workflows endpoint.
Example Response:
{
"workflow_id": 444444,
"_brand_id": 123456789,
"name": "Gather First and Last Name",
"description": "Will kick off when contact is created.",
"entry_rule": "oneAtTime",
"entry_rule_time_value": null,
"entry_rule_time_unit": null,
"active": 0,
"created": "2024-10-30 13:11:02",
"last_updated": "2024-11-20 17:10:32",
"last_activated": "2024-11-20 15:47:59",
"last_deactivated": "2024-11-20 17:10:32",
"last_cleared": "2024-11-20 15:59:02"
}
Edit a Specific Workflow
Allows you to edit existing workflows. You can target an existing workflow by passing the Workflow ID in your PUT request. The Workflow ID can be found using the retrieve all workflows endpoint.
Arguments:
| PARAMETER | DESCRIPTION |
|---|---|
| name | Name of workflow |
| description | Description of workflow |
| entry_rule | Determines entry rules for a workflow (once, oneAtTime, onceInTime, or multiple) |
| entry_rule_time_value | Number of time units to restrict workflow re-entry (required when entry_rule is "onceInTime") |
| entry_rule_time_unit | Unit of time for restriction: "second", "minute", "hour", or "day" (required when entry_rule is "onceInTime") |
| active | 1 for active, 0 for inactive |
Example Request Body:
{
"name": "Gather First and Last Name",
"description": "Will kick off when contact is created.",
"entry_rule": "oneAtTime",
"active": 0
}
Example Request Body with Time Restriction:
{
"name": "Welcome Series",
"description": "Welcome workflow that can run once every 30 days.",
"entry_rule": "onceInTime",
"entry_rule_time_value": 30,
"entry_rule_time_unit": "day",
"active": 1
}
Example Response:
{
"workflow_id": 444444,
"_brand_id": 123456789,
"name": "Gather First and Last Name",
"description": "Will kick off when contact is created.",
"entry_rule": "oneAtTime",
"entry_rule_time_value": null,
"entry_rule_time_unit": null,
"active": 0,
"created": "2024-10-30 13:11:02",
"last_updated": "2024-11-20 17:10:32",
"last_activated": "2024-11-20 15:47:59",
"last_deactivated": "2024-11-20 17:10:32",
"last_cleared": "2024-11-20 15:59:02"
}
Delete a Specific Workflow
Deletes an existing workflow with the Workflow ID equal to {id}. The Workflow ID can be found using the retrieve all workflows endpoint. Using this action, the workflow is simply removed completely from the brand.
Example Response:
[]