Triggering a workflow from an AI agent (the trigger_workflow tool)
An AI agent can fire an existing workflow mid-conversation using the "Trigger workflows" tool.
The Trigger workflows tool (trigger_workflow) lets an AI agent fire, mid-conversation, any workflow you've already built in your workspace — send a WhatsApp template, hand off the conversation, add the contact to a campaign, and so on. The agent doesn't create new workflows; it only activates ones you built and left active.
Requirements
- The target workflow must exist under Workflows and be Active (an inactive workflow is rejected).
- The workflow and the agent must belong to the same workspace — an agent can never trigger another workspace's workflow, even if it somehow learns the ID.
- The tool must be enabled on the agent's Tools tab.
Steps
- Build and activate the workflow under Workflows (give it a clear name; the kebab-case slug, e.g.
vip-welcome, is generated automatically). - Note the workflow's slug (it's listed under "Available workflows" in the tool's panel).
- Under Settings → AI Agents, open the agent, go to the Tools tab, and enable "Trigger workflows".
- In the agent's instructions, describe when to use it and which workflow, referencing the slug (e.g. "if the customer asks about renewal, trigger the
renewal-reminderworkflow").
Example
A customer messages the bot: "I want to renew my plan." The agent detects the intent, calls trigger_workflow with workflow_slug: "renewal-reminder", and the workflow takes over — sending the renewal template and tagging the contact — with no human intervention needed.
Tips
- Always prefer
workflow_slug(human-readable) overworkflow_id(legacy numeric). - You can pass
variables(key-value pairs) that the workflow receives as input variables. - Executions fired by an AI agent are tagged as
ai_agenttype in the execution history, so you can tell them apart from manual runs.
Troubleshooting
- "workflow not found": double-check the slug and confirm the workflow belongs to the agent's workspace.
- "workflow is not active": activate the workflow from the Workflows list before the agent can trigger it.
- If the agent never calls the tool, confirm it's enabled under Tools and that the instructions explicitly mention the right slug.
Related articles
-
Build your first workflow
Omnifox workflows automate your operation: a trigger starts the automation and action nodes do the work. Build a welcome message in minutes.
-
Workflow triggers catalog
Learn which events can start a workflow automatically in Omnifox.
-
Action nodes available in workflows
Discover the actions a workflow can run automatically.
-
Conditions and branching (if/then) in a workflow
Make your flows take decisions and follow different paths based on each contact data.
-
Ready-to-use workflow templates
Start your automations in minutes from prebuilt flows you can customize.