> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting AI agents to workflows

> Trigger workflows from bot interactions and use workflow results in bot responses.

## Why connect AI agents to workflows?

AI agents excel at conversations. Workflows excel at automation. When you connect them, you get the best of both worlds: intelligent, natural conversations that trigger powerful behind-the-scenes automation.

A standalone AI agent can answer questions and collect information. A standalone workflow can send emails and update records. Together, they can have a conversation with a lead, qualify them in real time, book an appointment, notify your sales team, add the contact to a nurture sequence, and send a personalized follow-up — all without human intervention.

## How the connection works

The integration between AI agents and workflows operates in two directions:

1. **Bot to workflow** — The AI agent triggers a workflow based on something that happens during the conversation (e.g., the contact expresses interest, provides qualifying information, or requests a callback)
2. **Workflow to bot** — A workflow activates an AI agent to initiate or continue a conversation (e.g., a timed follow-up, a re-engagement message, or a post-purchase check-in)

Both directions can be chained together, creating sophisticated automation sequences that feel personal and responsive.

<Frame caption="Conversation AI bot configuration showing the connection between AI agents and workflows">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-0-conversation-20ai.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=f40b5bb4ec4845cbc48213a3429ce7ed" alt="Conversation AI configuration panel for triggering workflows" width="1610" height="484" data-path="images/ai-agents-how-to-trigger-a-workflow-with-0-conversation-20ai.png" />
</Frame>

<Frame caption="Setting up the Conversation AI workflow action step by step">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/oH0mhc8NmMZh9gao/images/help-center-workflow-ai-conversation-ai-action-setup.gif?s=ed316faa8f511bc73563cbd751b74229" alt="Animated walkthrough of adding and configuring the Conversation AI action in a workflow" width="926" height="516" data-path="images/help-center-workflow-ai-conversation-ai-action-setup.gif" />
</Frame>

## Triggering workflows from AI agents

<Steps>
  <Step title="Open your AI agent configuration">
    Navigate to **AI Agents** and select the agent you want to connect to a workflow. Go to the agent's **Actions** tab.
  </Step>

  <Step title="Add a workflow trigger action">
    In the actions list, find **Trigger Workflow**. This action tells HoopAI to start a specific workflow when the AI agent determines the right moment during a conversation.

    <Frame caption="Bot goals configuration for defining when to trigger a workflow">
      <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-1-bot-20goals.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=0170e0389a6004e4a78d8f731a58c782" alt="Bot goals panel showing workflow trigger conditions" width="968" height="608" data-path="images/ai-agents-how-to-trigger-a-workflow-with-1-bot-20goals.png" />
    </Frame>
  </Step>

  <Step title="Select the target workflow">
    Choose which workflow to trigger from the dropdown. The workflow must already exist in your **Automation > Workflows** section. You can select any workflow that uses a compatible trigger type.

    <Frame caption="Selecting the target workflow to trigger from the AI agent">
      <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-4-select-20workflow.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=cb1161d10fd13f8f0c52340fc612f334" alt="Dropdown to select which workflow the AI agent should trigger" width="1016" height="658" data-path="images/ai-agents-how-to-trigger-a-workflow-with-4-select-20workflow.png" />
    </Frame>
  </Step>

  <Step title="Define the trigger conditions">
    Specify when the AI agent should fire the workflow. Common conditions include:

    * The contact provides a specific piece of information (email, phone, service need)
    * The conversation reaches a particular intent (wants to book, ready to buy, needs support)
    * The contact explicitly requests something (callback, pricing, brochure)
  </Step>

  <Step title="Map conversation data to workflow fields">
    Pass data collected during the conversation into the workflow. Map extracted information like name, email, service interest, and budget to contact fields or workflow variables.
  </Step>

  <Step title="Test the full chain">
    Start a test conversation with your AI agent. Provide the information that should trigger the workflow. Verify that the workflow starts and receives the correct data.
  </Step>
</Steps>

<Note>
  The AI agent continues the conversation even after triggering a workflow. The workflow runs in the background while the agent keeps engaging the contact. This creates a seamless experience where the contact never knows automation is happening behind the scenes.
</Note>

<Frame caption="Selecting which messaging channel the Conversation AI action should monitor">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/oH0mhc8NmMZh9gao/images/help-center-workflow-ai-conversation-ai-action-channel.png?fit=max&auto=format&n=oH0mhc8NmMZh9gao&q=85&s=792689e4ce990174a0f4553da0a6fc8f" alt="Channel selection dropdown for the Conversation AI workflow action" width="584" height="403" data-path="images/help-center-workflow-ai-conversation-ai-action-channel.png" />
</Frame>

<Frame caption="Configuring branch paths based on the AI agent conversation outcomes">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/oH0mhc8NmMZh9gao/images/help-center-workflow-ai-conversation-ai-action-branches.png?fit=max&auto=format&n=oH0mhc8NmMZh9gao&q=85&s=ecabc48faee7f4d969e8d24347d45918" alt="Branch configuration showing different paths for Conversation AI action results" width="775" height="351" data-path="images/help-center-workflow-ai-conversation-ai-action-branches.png" />
</Frame>

<Frame caption="Configuring when the AI agent should trigger the workflow during a conversation">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-5-when-20to-20trigger.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=9c4f3f48362f456a845b3e345f2292cb" alt="When to trigger workflow settings panel" width="1016" height="658" data-path="images/ai-agents-how-to-trigger-a-workflow-with-5-when-20to-20trigger.png" />
</Frame>

<Frame caption="Selecting the workflow trigger from the AI agent action configuration">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-2-trigger-20workflow.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=3274861efd4f75cec4c1c0ad0ce1694c" alt="Workflow trigger setup in AI agent actions panel" width="866" height="645" data-path="images/ai-agents-how-to-trigger-a-workflow-with-2-trigger-20workflow.png" />
</Frame>

## Passing conversation context

When an AI agent triggers a workflow, you can pass rich conversation context beyond simple field values:

### Available context data

| Data type            | Description                              | Example use                         |
| -------------------- | ---------------------------------------- | ----------------------------------- |
| Collected fields     | Structured data the bot extracted        | Name, email, phone, service type    |
| Conversation summary | AI-generated summary of the chat         | Include in internal notifications   |
| Contact intent       | What the contact is trying to accomplish | Route to correct department         |
| Sentiment            | The contact's emotional state            | Prioritize negative sentiment       |
| Full transcript      | Complete conversation history            | Attach to support tickets           |
| Custom variables     | Bot-specific variables you defined       | Budget range, timeline, preferences |

### Mapping conversation data to contact fields

During the AI agent setup, you define which pieces of information the agent should extract. These map directly to HoopAI contact fields:

```text theme={null}
Bot extracts "service_needed" → Maps to custom field "Service Interest"
Bot extracts "budget" → Maps to custom field "Budget Range"
Bot extracts "timeline" → Maps to custom field "Project Timeline"
```

Once mapped, these fields are available to the triggered workflow via standard merge fields like `{{contact.custom_field.service_interest}}`.

## Using workflow results in bot responses

Sometimes you need a workflow to process data and return results to the AI agent. This creates a round-trip: the bot collects information, a workflow processes it, and the bot delivers the result.

### Common round-trip scenarios

<AccordionGroup>
  <Accordion title="Real-time pricing lookup">
    **Flow:**

    1. Contact asks about pricing for a specific service
    2. AI agent collects service details and location
    3. Workflow triggers: looks up pricing from a custom values list or external API via webhook
    4. Pricing data returns to the conversation
    5. AI agent presents the quote naturally in conversation

    **Configuration:** Use a webhook action in the workflow to call your pricing API, then store the result in a contact custom field that the AI agent can reference.
  </Accordion>

  <Accordion title="Appointment availability check">
    **Flow:**

    1. Contact wants to book an appointment
    2. AI agent asks for preferred date and time
    3. Workflow triggers: checks calendar availability
    4. Available slots return to the conversation
    5. AI agent presents options and confirms booking

    **Configuration:** The workflow checks the assigned user's calendar and updates a custom field with available slots. The AI agent reads this field and presents options.
  </Accordion>

  <Accordion title="Account status verification">
    **Flow:**

    1. Existing customer asks about their account
    2. AI agent collects identifying information
    3. Workflow triggers: pulls account details from your system
    4. Account information returns to the conversation
    5. AI agent shares relevant details while protecting sensitive data

    **Configuration:** Use conditional logic in your AI agent to determine what information is safe to share and what requires human handoff.
  </Accordion>
</AccordionGroup>

<Frame caption="Configuring the action name when connecting an AI agent to a workflow">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-3-action-20name.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=4121dee3a40cff60f0ec11ecca473252" alt="Action name field in the workflow trigger configuration" width="1016" height="658" data-path="images/ai-agents-how-to-trigger-a-workflow-with-3-action-20name.png" />
</Frame>

## Bot to workflow to bot chains

The most powerful automation patterns chain multiple handoffs between AI agents and workflows. Here is a complete example:

### Lead qualification chain

```text theme={null}
1. Website visitor starts chat
   └─ AI Agent: Greets visitor, asks qualifying questions

2. Visitor provides budget and timeline
   └─ AI Agent: Triggers "Lead Scoring" workflow

3. Lead Scoring workflow runs
   ├─ AI Action: Scores lead 1-10 based on all data
   ├─ Update Contact: Stores score in custom field
   └─ If/Else: Score >= 7?
       ├─ Yes: Tag "hot_lead", notify sales on Slack
       └─ No: Tag "nurture_lead"

4. AI Agent reads the score from the contact field
   ├─ Hot lead: "Great news! Let me connect you with a specialist.
   │   When works best for a quick call?"
   └─ Nurture lead: "Thanks for your interest! I'll send you some
       resources that might help."

5. Based on response:
   └─ Hot lead books appointment → Triggers "Appointment Booked" workflow
   └─ Nurture lead → Triggers "Drip Sequence" workflow
```

This chain handles the entire lead journey from first contact to qualified handoff, automatically.

<Frame caption="Saving the workflow trigger configuration for your AI agent">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/pMRqsx_Tmg1Lacem/images/ai-agents-how-to-trigger-a-workflow-with-6-save.png?fit=max&auto=format&n=pMRqsx_Tmg1Lacem&q=85&s=d300699a8e47d3518fd398e8aed52218" alt="Save button for workflow trigger action setup" width="1031" height="529" data-path="images/ai-agents-how-to-trigger-a-workflow-with-6-save.png" />
</Frame>

## Auto follow-up workflows

One of the most valuable patterns is using workflows to follow up after bot conversations end.

### Post-conversation follow-up

<Steps>
  <Step title="Create a workflow with the trigger 'Conversation ended'">
    Set the trigger to fire when an AI agent conversation ends. You can filter by which agent or conversation channel.
  </Step>

  <Step title="Add a wait step">
    Insert a delay — typically 30 minutes to 24 hours depending on your use case. This gives the contact time before receiving follow-up.
  </Step>

  <Step title="Add conditional logic">
    Check whether the conversation resulted in a booking, a sale, or just an inquiry. Route each outcome differently.
  </Step>

  <Step title="Configure follow-up actions">
    * **Booked appointment:** Send confirmation email with details
    * **Expressed interest but did not book:** Send a "still interested?" message with a booking link
    * **Just browsing:** Add to a general nurture sequence
    * **Negative experience:** Alert team for personal outreach
  </Step>
</Steps>

<Tip>
  Set up a re-engagement workflow that triggers if a contact who chatted with your AI agent has not converted within 48 hours. A well-timed follow-up message can recover leads that would otherwise go cold.
</Tip>

## Contact tagging from AI agents

AI agents can apply tags during conversations, which then serve as workflow triggers or conditions.

### Strategic tagging patterns

| Conversation event                 | Tag applied          | Workflow triggered              |
| ---------------------------------- | -------------------- | ------------------------------- |
| Contact asks about pricing         | `interested_pricing` | Send pricing follow-up sequence |
| Contact mentions competitor        | `competitor_aware`   | Send comparison content         |
| Contact expresses urgency          | `urgent_need`        | Priority sales notification     |
| Contact requests human             | `wants_human`        | Immediate team alert            |
| Contact provides positive feedback | `happy_customer`     | Request review workflow         |
| Contact mentions referral          | `referral_lead`      | Referral tracking workflow      |

### Setting up tag-based workflows

1. In your AI agent, configure actions to apply specific tags based on conversation context
2. In **Automation > Workflows**, create workflows with the trigger **Tag Added**
3. Filter by the specific tag name
4. Build your automation sequence

This creates a loosely coupled system where the AI agent and workflows communicate through tags. The advantage is flexibility — you can modify workflows without changing the AI agent, and vice versa.

<Frame caption="Complete example showing a Conversation AI action integrated into a lead qualification workflow">
  <img src="https://mintcdn.com/hoopai-84ec0cdc/oH0mhc8NmMZh9gao/images/help-center-workflow-ai-conversation-ai-action-example.png?fit=max&auto=format&n=oH0mhc8NmMZh9gao&q=85&s=0ddbbcffdef0a2f975814de53ab0b501" alt="Full workflow example with Conversation AI action and downstream steps" width="231" height="98" data-path="images/help-center-workflow-ai-conversation-ai-action-example.png" />
</Frame>

## Best practices for AI agent and workflow integration

### Design principles

* **Keep AI agents focused on conversation.** Let workflows handle the backend automation. Do not try to make the AI agent do everything.
* **Use clear handoff points.** Define exactly when and why a workflow should trigger. Ambiguous trigger conditions lead to unreliable automation.
* **Always include fallbacks.** If a workflow fails or returns unexpected data, the AI agent should have a graceful response rather than breaking the conversation.
* **Test the complete chain.** Testing the AI agent alone or the workflow alone is not enough. Test them together with realistic data.

### Performance tips

* Minimize the number of workflow triggers per conversation to conserve AI credits
* Use tags for simple routing and reserve workflow triggers for complex multi-step processes
* Add short wait steps between bot-to-workflow triggers to prevent race conditions
* Monitor workflow execution logs alongside conversation logs to debug issues

<Warning>
  Avoid creating circular triggers where a workflow triggers a bot that triggers the same workflow. This can create infinite loops and consume your AI credits rapidly. Always include exit conditions in your chains.
</Warning>

### Debugging connection issues

| Symptom                           | Likely cause                       | Fix                                                        |
| --------------------------------- | ---------------------------------- | ---------------------------------------------------------- |
| Workflow never triggers           | Trigger conditions too restrictive | Broaden conditions, check AI agent action config           |
| Workflow triggers multiple times  | Missing deduplication              | Add a "has tag" condition to prevent re-triggering         |
| Data missing in workflow          | Field mapping incorrect            | Verify custom field names match between agent and workflow |
| Bot does not see workflow results | Timing issue                       | Add a short wait in the bot before reading updated fields  |
| Conversation feels disconnected   | No context passing                 | Include conversation summary in workflow notifications     |

## Next steps

<CardGroup cols={2}>
  <Card title="Conversation AI actions" icon="bolt" href="/ai-agents/conversation-ai-actions">
    Deep dive into all available AI agent actions.
  </Card>

  <Card title="AI actions in workflows" icon="bolt" href="/ai/workflow-ai/gpt-actions">
    Add AI-powered generation steps to your workflows.
  </Card>

  <Card title="Workflow examples" icon="book-open" href="/ai/workflow-ai/examples">
    Complete recipes combining AI agents with workflows.
  </Card>

  <Card title="Automation overview" icon="gears" href="/automation/overview">
    Master the fundamentals of HoopAI workflow automation.
  </Card>
</CardGroup>
