Automation scenarios tools

🚧

Warning

Write tools change your live configuration. Just like changes made in the Bloomreach Engagement dashboard, actions your users or agents take with these tools can have a substantial impact on your campaigns, automations, and customer communications. There is no automatic rollback and activity logging is limited, so review every change and confirm the target before applying it.

search_scenarios

Searches the scenarios (automation flow campaigns) in a project, or fetches one by ID. Scenarios are multi-step flows with triggers, conditions, waits, and actions. Omit scenario_id to list all scenarios as summary records: name, status, tags, archived flag, and initiative assignment. The node graph is excluded from the list — pass scenario_id, or use the lighter-weight list_scenario_nodes, to explore it.

Pass scenario_id to fetch the complete scenario definition, including the trigger, every node in the flow graph (waits, conditions, actions, A/B splits), the global customer filter, and metadata. Email and SMS design payloads are stripped from nodes by default to keep responses manageable. Set include_node_designs to true to include them, though design blobs can be 70 KB or more per node.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
scenario_idstr | nullNoThe scenario ID. Omit to list all; provide to fetch one.
include_node_designsboolNoWhen fetching a single scenario, include the full email or SMS design payload in action nodes. Ignored when scenario_id is omitted. Defaults to false.

Response parameters

The tool returns a ScenariosResponse when scenario_id is omitted, or a ScenarioResponse when it's provided.

The ScenariosResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[ScenarioSummary]The scenario summaries.
errorstr | nullError message if the request failed.

The ScenarioSummary object has the following fields:

FieldTypeDescription
idstrThe scenario's unique ID.
namestrThe scenario's display name.
statusstrOne of draft, active, inactive, finishing, or finished.
archivedboolWhether the scenario has been archived.
tagslist[str]User-defined tags.
initiative_idstr | nullThe initiative this scenario belongs to, if any.
is_global_objectbool | nullWhether the scenario is a global, shared object.
createdany | nullUnix timestamp of when the scenario was created.
created_by_display_namestr | nullDisplay name of the creator.
editedany | nullUnix timestamp of the last edit.
edited_by_display_namestr | nullDisplay name of the last editor.

When scenario_id is provided, the tool returns a ScenarioResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataScenario | nullThe full scenario definition.
errorstr | nullError message if the request failed.

The Scenario object adds the following fields on top of the summary record:

FieldTypeDescription
triggerany | nullThe entry trigger: an event, a schedule, or an API call.
nodeslist[any]The scenario node graph. Each node is one step in the flow — a wait, an action, a condition, an A/B split, and so on.
customer_filterany | nullThe global filter that decides which customers can enter the scenario.
max_customersint | nullThe maximum number of customers allowed in the scenario at one time.

list_scenario_nodes

Returns a lightweight skeleton of a scenario's node graph: just the node IDs, types, names, and the connections (edges) between them. Use this to explore a scenario's structure before pulling individual nodes with get_scenario_node.

The scenario is fetched once and cached for 60 seconds, so back-to-back calls to list_scenario_nodes and get_scenario_node on the same scenario share a single underlying request.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
scenario_idstrYesThe scenario ID returned by search_scenarios.

Response parameters

The tool returns a ScenarioNodesResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
scenario_idstrThe scenario's ID.
scenario_namestrThe scenario's display name.
nodeslist[ScenarioNodeSummary]A lightweight list of nodes: ID, type, and name only.
connectionslist[any]The graph edges. Each entry has a source (node_id plus connector_index) and a destination. On branching nodes (condition and ab-split), the connector_index identifies which output branch: 0 is the yes or first variant, 1 is the no or second variant, and so on.
triggeranyThe entry trigger configuration for the scenario.
errorstr | nullError message if the request failed.

The ScenarioNodeSummary object has the following fields:

FieldTypeDescription
idintThe numeric node ID, unique within the scenario.
typestrThe node type, for example send-email-action, condition, wait-action, or ab-split.
namestr | nullAn optional display label set by the scenario author.
incoming_connectionslist[any]The edges arriving at this node from parent nodes. Empty for entry-point trigger nodes.
outgoing_connectionslist[any]The edges leaving this node toward child nodes. On branching nodes, connector_index identifies which branch.

get_scenario_node

Returns the full configuration for a single node in a scenario, along with the incoming and outgoing edges. The scenario is fetched once and cached for 60 seconds, so this is efficient to call repeatedly on the same scenario.

The design payload on action nodes (email or MMS templates) is omitted by default because a single design can run to 70 KB or more. Set include_design to true if you need the template content.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
scenario_idstrYesThe scenario ID returned by search_scenarios.
node_idintYesThe numeric node ID. Use list_scenario_nodes to discover node IDs.
include_designboolNoIf true, include the design field on action nodes. Defaults to false.

Response parameters

The tool returns a ScenarioNodeResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
scenario_idstrThe scenario this node belongs to.
nodeany | nullThe full node configuration. The shape varies by node type.
incoming_connectionslist[any]The edges arriving at this node from parent nodes. Empty for entry-point nodes.
outgoing_connectionslist[any]The edges leaving this node toward child nodes. On branching nodes, connector_index identifies which branch. Empty for terminal nodes.
errorstr | nullError message if the request failed or the node was not found.

create_scenario

Creates a new scenario (automation flow). The scenario is always created as a draft — it does not run until it is activated in the Bloomreach Engagement UI. On success, the tool returns the ID of the new scenario.

The payload requires a name, a nodes list with at minimum one trigger node, a connections list of edges between nodes (empty for a trigger-only scenario), and a last_node_id set to the highest node ID present in nodes. A trigger node's type can be on-event-trigger, on-api-trigger, on-date-attribute-trigger, repeated-trigger, planned-trigger, or now-trigger, and each type has its own required sub-fields.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
payloaddictYesThe scenario definition. Requires name, nodes, connections, and last_node_id.

Response parameters

The tool returns a WriteResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the operation succeeded.
idstr | nullThe ID of the newly created scenario.
errorstr | nullError or validation detail if the operation failed.

update_scenario

Replaces the full definition of an existing scenario with the payload you provide (PUT semantics), so pass the complete scenario, not just the fields you want to change. The typical workflow is to fetch the current definition with search_scenarios, modify the fields you need, then pass the whole modified object here. The scenario must be in draft or inactive status — running scenarios cannot be modified, and status transitions such as activate and stop must be done through the Engagement UI.

Keep existing node IDs intact, since the backend matches nodes by ID and treats a changed ID as deleting the old node and creating a new one. Set last_node_id to the highest node ID in the nodes array, and update it whenever you add new nodes. Find scenario IDs with search_scenarios.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
scenario_idstrYesThe scenario ID returned by search_scenarios or create_scenario.
payloaddictYesThe full updated scenario definition, in the same shape as create.

Response parameters

The tool returns a WriteResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the operation succeeded.
idstr | nullThe ID of the updated scenario.
errorstr | nullError or validation detail if the operation failed.

delete_scenario

Permanently deletes a scenario. The scenario must be in draft or inactive status — running scenarios cannot be deleted. This action is irreversible: the scenario and all its node configuration are removed, and there is no undo through this tool, so verify the target before you run it.

Find scenario IDs with search_scenarios.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
scenario_idstrYesThe scenario ID returned by search_scenarios.

Response parameters

The tool returns a WriteResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the operation succeeded.
idstr | nullNot present for deletes.
errorstr | nullError detail if the operation failed.


Did this page help you?

© Bloomreach, Inc. All rights reserved.