Build Workflow Agents
Why workflow agents exist
Section titled “Why workflow agents exist”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.
How workflow agents work
Section titled “How workflow agents work”A workflow agent consists of three components:
- Triggers define what starts the workflow (a chat command, a schedule, a webhook, or an incoming email)
- Logic adds decision-making with conditions (if-then branching) and loops (for-each iteration)
- 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.
Create a workflow agent
Section titled “Create a workflow agent”- Navigate to Opal > Agents > Your Agents
- Click Add Agent and select Workflow Agent
- Enter a name for the workflow
- Toggle Active status (keep off during development)
- Provide a unique ID (verified as available)
- Add a description explaining the workflow’s purpose
- Click Apply
Add a trigger
Section titled “Add a trigger”Every workflow needs at least one trigger. Drag a trigger from the Components panel into the workspace and configure it.
Add agents
Section titled “Add agents”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.
Add logic (optional)
Section titled “Add logic (optional)”Drag Condition or Loop elements from the Logic section to add branching or iteration between agents.
Save and activate
Section titled “Save and activate”Click Save, then toggle Active to on when you are ready to run the workflow.
Trigger types
Section titled “Trigger types”Chat Input
Section titled “Chat Input”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.
Scheduler
Section titled “Scheduler”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:
| Schedule | Cron expression |
|---|---|
| Daily at midnight | 0 0 * * * |
| Weekdays at 9 AM | 0 9 * * 1-5 |
| Weekly on Sunday | 0 9 * * 0 |
| Monthly on the 1st | 0 8 1 * * |
| Every other day | 0 7 */2 * * |
Webhook
Section titled “Webhook”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.
Trigger considerations
Section titled “Trigger considerations”- 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
Section titled “Conditions”Conditions add if-then branching that evaluates criteria and directs the workflow down different paths.
When to use conditions
Section titled “When to use conditions”- 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
Add a condition
Section titled “Add a condition”- Drag a Condition from Logic into the workspace
- Connect it between agents using connector lines
- Select a match type: Equals, Not Equals, Contains, Not Contains, Greater Than, Less Than, Greater Than or Equals, Less Than or Equals, or Regex
- Enter the condition value to check against
- Connect agents to both the true and false (else) paths
- Click Save
Condition best practices
Section titled “Condition best practices”- 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).
When to use loops
Section titled “When to use loops”- 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
Add a loop
Section titled “Add a loop”- Drag a Loop from Logic into the workspace
- Connect an agent that provides the collection (the data source) to the loop
- Drag agents, conditions, or nested loops into the loop body
- Click Save
Loop best practices
Section titled “Loop best practices”- 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
Test a workflow agent
Section titled “Test a workflow agent”Before activating a workflow in production:
- Navigate to your workflow agent
- Click Test to run a simulation
- Review the execution log for each step
- Verify outputs at each stage match expectations
- Check that conditions route correctly for both true and false paths
Monitor workflow execution
Section titled “Monitor workflow execution”- 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
Import and export
Section titled “Import and export”Share workflow agents across instances using JSON:
Export: Use the agent management interface to export your workflow as JSON.
Import:
- Ensure all embedded specialized agents exist in the target instance
- Navigate to Agents > Add Agent > Import Agent
- Paste the JSON configuration
- Toggle import mode to control overwriting
- Click Import Agent
For single instances, duplicate the workflow instead of using JSON import.