FlowBotBeta

Executions

Workflow executions

What is an execution ?

Workflow execution is the heart of FlowBot’s automation engine, bringing your workflows to life. This process involves running a predefined sequence of nodes triggered by specific events, such as a WhatsApp user’s message or media input. Understanding how executions work is key to optimizing your automation strategy.

Workflows Overview

Understanding Workflow Execution

What Happens During Execution?

An execution is the step-by-step processing of a workflow, initiated by a trigger event. For instance, a text message, an api call or a scheduled task can start the flow. Each execution follows this cycle:

  • Trigger: An event (e.g., user message) activates the workflow.
  • Processing: Nodes are executed in order, evaluating variables and conditions.
  • Outcome: The execution can succeed, fail, or generate an error message for debugging.

Real-Time Tracking

FlowBot provides real-time monitoring of executions through the dashboard. Track the status, duration, and any errors to ensure smooth operation and quick troubleshooting.

Variables in Workflows

Every execution operates within its own context, a dynamic environment where variables are evaluated. Variables are the building blocks of dynamic workflows in FlowBot, allowing you to store, manipulate, and reuse data throughout your automation processes. They enable personalized interactions, integrate with external systems, and enhance workflow flexibility. Below, we explore the available variables and how to create custom ones.

Available Variables

FlowBot provides a range of pre-defined variables to capture and utilize data from user interactions and workflow states. These variables are accessed using the ${{variable_name}} syntax. Variables can be utilized anywhere using the format ${{variable}}.

Message Variables

These variables are derived from the previous message or interaction:

  • ${{prev.meta}}: Contains all additional details for a given input, such as request status, headers, and message metadata.
  • ${{prev.meta.id}}: The unique response ID.
  • ${{prev.meta.tracker}}: The Button ID for interactive messages.
  • ${{prev.meta.type}}: The response type (e.g., TEXT, IMAGE, VIDEO).
  • ${{prev.meta.media}}: The media content if the response includes media.
  • ${{prev.meta.sender}}: The user who sent the message.
  • ${{prev.meta.from_number}}: The phone number of the responding user.
  • ${{prev.meta.timestamp}}: The timestamp when the response was received.
  • ${{prev.meta.reply_to_message.message_id}}: The ID of the message being replied to (if applicable).
  • ${{prev.meta.reaction.emoji}}: The emoji reaction from the user (if a reaction).
  • ${{prev.meta.forwarded}}: Indicates if the message was forwarded (true/false).
  • ${{prev.meta.has_media}}: Indicates if the response contains media (true/false).
  • ${{prev.meta.is_reply}}: Indicates if the response is a reply to a previous message (true/false).

Context and Output Variables

These variables provide broader context and workflow output:

  • ${{contacts}}: An array of your contacts {name: string, phone: string}[].
  • ${{context.sender}}: The phone number of the user who sent the current message.
  • ${{prev.output}}: The output from the last executed node, if available.

Creating External Variables

In addition to pre-defined variables, you can create external variables to enhance your workflows. These are custom values stored outside the workflow, such as API keys or configuration settings, and can be referenced within nodes.

Key Features

  • Real-Time Monitoring: View live execution status and historical data in the dashboard.
  • Error Handling: Access detailed error messages to identify and fix issues swiftly.
  • Contextual Variables: Leverage dynamic variables for personalized and efficient workflows.

Best Practices

  • Test Thoroughly: Simulate executions with sample data to catch potential failures.
  • Monitor Regularly: Check execution logs to maintain optimal performance.
  • Use Descriptive Variables: Name variables clearly (e.g., userName) for easier management.