Skip to content

Build Workflow Agents

⏱ 25 minutes advanced
📜AdvancedOpal

Specialized agents handle single tasks well, but real business processes involve sequences. A content review pipeline needs someone to fetch the draft, analyze it for brand compliance, route it based on priority, and notify the right editor. Doing this manually means remembering every step and executing them in order. Workflow agents automate these sequences by chaining agents, triggers, and logic into repeatable processes that run without intervention.

A workflow agent consists of three components:

  1. Triggers define what starts the workflow (a chat command, a schedule, a webhook, or an incoming email)
  2. Logic adds decision-making with conditions (if-then branching) and loops (for-each iteration)
  3. Agents perform the actual work at each step in the sequence

You build workflows visually by dragging components into a workspace and connecting them with lines that define execution order.

  1. Navigate to Opal > Agents > Your Agents
  2. Click Add Agent and select Workflow Agent
  3. Enter a name for the workflow
  4. Toggle Active status (keep off during development)
  5. Provide a unique ID (verified as available)
  6. Add a description explaining the workflow’s purpose
  7. Click Apply

Every workflow needs at least one trigger. Drag a trigger from the Components panel into the workspace and configure it.

Drag specialized agents from the Agents panel into the workspace. Connect the trigger to the first agent by clicking the connector circle and dragging to the agent.

Drag Condition or Loop elements from the Logic section to add branching or iteration between agents.

Click Save, then toggle Active to on when you are ready to run the workflow.

Starts the workflow when a user sends a message in Opal Chat.

Best for: On-demand workflows that team members trigger directly.

Configuration: Enter a name and optional description. Users invoke the workflow by mentioning it in chat.

Starts the workflow at scheduled times. All times are configured in UTC.

Best for: Recurring tasks like daily reports, weekly audits, or monthly reviews.

Configuration options:

  • One-time: Set a specific date and time
  • Recurring (Standard): Select frequency, days, and end condition
  • Recurring (Advanced): Enter a cron expression for precise control

Common cron examples:

ScheduleCron expression
Daily at midnight0 0 * * *
Weekdays at 9 AM0 9 * * 1-5
Weekly on Sunday0 9 * * 0
Monthly on the 1st0 8 1 * *
Every other day0 7 */2 * *

Starts the workflow when an external system sends an HTTP request to a unique endpoint.

Best for: Event-driven automation triggered by external systems (build pipelines, CMS content updates, feature flag changes).

Configuration: Set the payload content type (JSON, form-urlencoded, or text/plain), optional payload schema for validation, and authentication credentials. The webhook URL is auto-generated after saving.

Important: Authentication settings (auth key, header name, header format) cannot be changed after saving. Delete and recreate the trigger if you need to change them.

Starts the workflow when an email arrives at a designated trigger address matching sender and subject filters.

Best for: Human-in-the-loop workflows like approvals, vendor intake, and lightweight ticketing.

Prerequisites: Configure your email domain in Opal Settings before creating email triggers.

Configuration: Define a trigger recipient email address, required sender filters, and optional subject filters with case-sensitive matching.

Limitations: Custom domains and Reply-To headers are not supported. Opal uses DKIM, DMARC, and SPF for deliverability.

  • Triggers connect to specific Optimizely product instances at creation. Changing the connection after creation may cause unexpected behavior. Establish connections first, then create triggers.
  • Workflow actions display as performed by the user who created the trigger.
  • All description fields affect how Opal processes agents. Write complete, accurate descriptions.

Conditions add if-then branching that evaluates criteria and directs the workflow down different paths.

  • Dynamic routing: Direct tasks to different teams based on content type, priority, or campaign
  • Conditional execution: Run actions only when prerequisites are met
  • Data validation: Verify inputs meet requirements before proceeding
  1. Drag a Condition from Logic into the workspace
  2. Connect it between agents using connector lines
  3. Select a match type: Equals, Not Equals, Contains, Not Contains, Greater Than, Less Than, Greater Than or Equals, Less Than or Equals, or Regex
  4. Enter the condition value to check against
  5. Connect agents to both the true and false (else) paths
  6. Click Save
  • Use precise, unambiguous criteria
  • Account for both true and false paths to prevent workflow stalls
  • Confirm required data exists in the correct format from previous agent outputs
  • Break complex decision trees into sequential conditions rather than deeply nested logic
  • Nest conditions within loops for sophisticated adaptive logic

Loops automate repetitive tasks by iterating over collections of items (URLs, keywords, data sets, segments).

  • Processing lists: Apply the same action to each item in a list of assets, campaigns, or keywords
  • Generating variations: Create multiple content versions based on different parameters
  • Iterating data sets: Process collections of data points systematically
  1. Drag a Loop from Logic into the workspace
  2. Connect an agent that provides the collection (the data source) to the loop
  3. Drag agents, conditions, or nested loops into the loop body
  4. Click Save
  • Limit nesting to three levels maximum
  • Monitor iteration count — large loops impact execution time
  • Understand variable scope: variables defined inside a loop may behave differently than those defined outside

Before activating a workflow in production:

  1. Navigate to your workflow agent
  2. Click Test to run a simulation
  3. Review the execution log for each step
  4. Verify outputs at each stage match expectations
  5. Check that conditions route correctly for both true and false paths
  • Logs: View execution logs to trace each step’s inputs, outputs, and timing
  • Execution ID: Copy the execution ID from the logs for troubleshooting or support tickets
  • Credit consumption: Track per-workflow credit usage in the Opal usage dashboard

Share workflow agents across instances using JSON:

Export: Use the agent management interface to export your workflow as JSON.

Import:

  1. Ensure all embedded specialized agents exist in the target instance
  2. Navigate to Agents > Add Agent > Import Agent
  3. Paste the JSON configuration
  4. Toggle import mode to control overwriting
  5. Click Import Agent

For single instances, duplicate the workflow instead of using JSON import.