FlowBot
Workflow

Global Variables

Define and utilize global variables across your workflows.

Overview

Global variables are user-defined values that can be created once and reused across all your workflows. They're perfect for storing configuration settings, API keys, common values, or any data that needs to be shared between multiple workflows.

Unlike workflow-specific variables (created with Variable nodes), global variables are stored at the account level and are accessible in every workflow you create.

Creating Global Variables

Accessing the Variables Section

  1. Navigate to Workflows in the sidebar
  2. Click on the Variables tab
  3. You'll see a list of all your global variables (if any)
  4. Click Create Variable to add a new one

Variable Properties

When creating a global variable, you'll need to specify:

  • Name: The variable name (must start with a letter or underscore, and contain only letters, numbers, and underscores)
    • Examples: api_key, company_name, default_timezone
    • Invalid: 123var, my-var, var name
  • Value: The variable value (can be a string, number, boolean, JSON object, or array)
    • Plain string: "Hello World"
    • Number: 42
    • Boolean: true or false
    • JSON object: {"key": "value"}
    • JSON array: ["item1", "item2"]
  • Hidden: Toggle to hide the variable from autocomplete suggestions (useful for sensitive data like API keys)

Step-by-Step Creation

  1. Click Create Variable

    • A dialog will open with the variable form
  2. Enter Variable Name

    • Use descriptive names (e.g., stripe_api_key, support_email)
    • Follow naming conventions: start with letter/underscore, use snake_case
  3. Enter Variable Value

    • Type the value directly (for strings)
    • Or enter JSON for complex data structures
    • The system will automatically parse JSON if valid, otherwise treat it as a string
  4. **Optional: Set Hidden Flag

    • Enable if you want to hide this variable from autocomplete
    • Useful for sensitive information
  5. Save the Variable

    • Click Save or Submit
    • The variable is now available in all your workflows

Using Global Variables

Basic Usage

Reference global variables in any workflow node using the ${{variable_name}} syntax:

${{api_key}}
${{company_name}}
${{default_timezone}}

In Workflow Nodes

Global variables can be used in any node field that accepts variables:

Text Messages:

Text: "Welcome to ${{company_name}}! Contact us at ${{support_email}}"

API Calls:

Headers: {
  "Authorization": "Bearer ${{api_key}}",
  "Content-Type": "application/json"
}

Variable Nodes:

Variable Value: ${{default_timezone}}

Variable Completion

In the workflow editor:

  1. Start typing $ in any field
  2. A completion window will appear showing:
    • System variables (context, prev, etc.)
    • Runtime variables (from Variable nodes)
    • Global variables (your custom variables)
  3. Select a global variable to insert it
  4. Hidden variables won't appear unless you type their exact name

Variable Value Types

String Values

Simple text values:

Name: company_name
Value: FlowBot Inc

Usage: ${{company_name}}FlowBot Inc

Number Values

Numeric values:

Name: max_retries
Value: 3

Usage: ${{max_retries}}3

Boolean Values

True/false values:

Name: enable_notifications
Value: true

Usage: ${{enable_notifications}}true

JSON Object Values

Complex structured data:

Name: company_config
Value: {
  "name": "FlowBot",
  "support_email": "support@flowbot.cc",
  "timezone": "UTC"
}

Usage:

  • ${{company_config.name}}FlowBot
  • ${{company_config.support_email}}support@flowbot.cc

JSON Array Values

List of values:

Name: product_categories
Value: ["Electronics", "Clothing", "Books"]

Usage:

  • ${{product_categories[0]}}Electronics
  • ${{product_categories[1]}}Clothing

Common Use Cases

API Keys and Secrets

Store API keys securely:

Name: stripe_api_key
Value: sk_live_...
Hidden: true

Usage in API Call node:

Headers: {
  "Authorization": "Bearer ${{stripe_api_key}}"
}

Company Information

Store reusable company data:

Name: company_info
Value: {
  "name": "FlowBot",
  "phone": "+1234567890",
  "email": "hello@flowbot.cc",
  "address": "123 Main St"
}

Configuration Settings

Store workflow configuration:

Name: default_settings
Value: {
  "timeout": 30,
  "retry_count": 3,
  "enable_logging": true
}

Common Messages

Store reusable message templates:

Name: welcome_message
Value: "Welcome! How can we help you today?"

Environment-Specific Values

Store different values for different environments:

Name: api_base_url
Value: "https://api.production.com"

Advanced Features

Nested Property Access

For JSON object values, access nested properties:

Variable: company_config = {"contact": {"email": "support@example.com"}}
Usage: ${{company_config.contact.email}} → "support@example.com"

Array Indexing

For JSON array values, access elements by index:

Variable: colors = ["red", "green", "blue"]
Usage: ${{colors[0]}} → "red"

Variable Expressions

Use global variables in expressions:

${{max_retries}} * 2
${{company_name}} + " Support"

Managing Global Variables

Editing Variables

  1. Go to Workflows > Variables
  2. Find the variable you want to edit
  3. Click the edit icon
  4. Modify the name, value, or hidden flag
  5. Save changes

Deleting Variables

  1. Go to Workflows > Variables
  2. Find the variable you want to delete
  3. Click the delete icon
  4. Confirm deletion

Note: Deleting a variable will break any workflows that reference it. Make sure to update those workflows first.

Viewing Variable Usage

  • Check which workflows use a variable by searching for ${{variable_name}} in your workflows
  • Consider the impact before deleting or renaming variables

Best Practices

  • Use Descriptive Names: Choose clear, meaningful names (e.g., stripe_api_key not key1)
  • Naming Convention: Use snake_case for variable names (e.g., api_key, company_name)
  • Document Variables: Add descriptions when creating variables to help team members understand their purpose
  • Hide Sensitive Data: Use the "Hidden" flag for API keys, passwords, and other sensitive information
  • Organize by Purpose: Group related variables with consistent naming (e.g., stripe_api_key, stripe_webhook_secret)
  • Version Control: Keep track of variable changes, especially for production environments
  • Test Before Use: Verify global variables work correctly in test workflows before deploying
  • Avoid Hardcoding: Use global variables instead of hardcoding values in workflows
  • Centralize Configuration: Store all configuration values as global variables for easy management

Security Considerations

  • API Keys: Always mark API keys and secrets as "Hidden"
  • Sensitive Data: Don't store passwords or highly sensitive data in global variables
  • Access Control: Be mindful of who has access to your account and can view/edit variables
  • Audit Trail: Regularly review your global variables to ensure they're still needed and secure

Troubleshooting

Variable not appearing in autocomplete?

  • Check if the variable is marked as "Hidden" (you'll need to type the exact name)
  • Verify the variable name is correct
  • Ensure you're typing $ to trigger autocomplete

Variable not working in workflow?

  • Verify the variable name matches exactly (case-sensitive)
  • Check that the variable value is in the correct format
  • Ensure the variable exists in the Variables section

JSON parsing errors?

  • Validate your JSON syntax before saving
  • Use a JSON validator if needed
  • Remember: invalid JSON will be treated as a plain string
Screenshot demonstrating the creation and usage of global variables in the workflow editor.