Variables

Variables serve as secure, reusable containers for values across your automation ecosystem. Instead of hardcoding API keys, configuration settings, or email addresses into every single step, you can define them once as Variables and reference them anywhere.

Why Use Variables?

  • Centralized Control: Update an API key or setting in one place, and it instantly updates across all your workflows and agents.

  • Security: Use Secret Variables to encrypt sensitive data (like passwords and API tokens). These values are masked in logs and never exposed in the UI.

  • Portability: Build workflows that act differently based on the environment or team without changing the workflow structure.


Variable Scopes

Where you define a variable determines where it can be used. AgenticFlow offers four levels of scoping:

1. Project Variables (Global)

  • Access: Available to everything in the project (all Workflows, Agents, and Workforces).

  • Best For: Global API keys (OpenAI, Stripe), database credentials, or company-wide settings (e.g., brand_color).

  • Syntax: {{ var.project.variable_name }}

2. Workflow Variables

  • Access: Available only within the specific Workflow where they are defined.

  • Best For: Workflow-specific defaults (e.g., default_retry_count, admin_email_recipient).

  • Syntax: {{ var.workflow.variable_name }}

3. Agent Variables

  • Access: Available only to a specific Agent.

  • Best For: Personality settings, agent-specific memory limits, or distinct tool credentials for that agent.

  • Syntax: {{ var.agent.variable_name }}

4. Workforce Variables

  • Access: Available to all agents within a specific Workforce (Multi-Agent Team).

  • Best For: Shared goals, team-specific resources, or coordination parameters.

  • Syntax: {{ var.mas.variable_name }}


System Variables (Read-Only)

AgenticFlow automatically provides "System Variables" for every execution. These are read-only values that give you context about "who, what, and when" the automation is running.

Syntax: {{ sys.variable_name }}

Variable
Description
Example Output

sys.user_id

ID of the user who triggered the run

usr_8x92...

sys.project_id

ID of the current project

proj_ab12...

sys.workflow_id

ID of the current workflow

wf_abc123...

sys.workflow_run_id

Unique ID for this specific execution

run_xyz789...

sys.triggered_by

How the run started (manual, schedule, API)

manual

sys.timestamp

Current Unix timestamp (seconds)

1705680123

sys.datetime

Current ISO datetime

2024-01-19T10:30:00+00:00

sys.date

Current date (YYYY-MM-DD)

2024-01-19

sys.time

Current time (HH:MM:SS)

10:30:00


Creating & Configuring Variables

When adding a new variable in the Settings panel, you will configure:

Data Types

  • String: Text values (e.g., "Welcome to AgenticFlow").

  • Number: Decimal numbers (e.g., 0.75).

  • Integer: Whole numbers (e.g., 42).

  • Boolean: True/False usage flags.

Special Properties

  • Secret: Crucial for security. Checks this box to encrypt the value. It will be hidden from the UI after creation and masked in all execution logs.

  • Read-only: Prevents the variable from being modified during runtime.

  • Required: The workflow will refuse to start if this variable is empty.


How to Use Variables

You can use variables in almost any input field in the AgenticFlow builder using the "Double Curly Brace" syntax.

Syntax Cheat Sheet

Type
Syntax

Project

{{ var.project.your_var_name }}

Workflow

{{ var.workflow.your_var_name }}

Agent

{{ var.agent.your_var_name }}

Workforce

{{ var.mas.your_var_name }}

System

{{ sys.your_sys_var }}

Common Examples

1. Using a Secure API Key in a Header Instead of pasting your key directly, reference the secret project variable:

2. Dynamic File Naming Create unique filenames automatically using system date and run IDs:

Result: invoice_2024-01-19_run_xyz789.pdf

3. Conditional Logic Use a Boolean variable to control workflow paths:

Last updated