Using the Invoke AI Agent Workflow Action

Overview

The Invoke AI Agent action connects your CRM’s automation workflows with its AI agent system. It allows a workflow to send data to a pre-built AI agent, process the agent's response, and then continue with the next steps in the automation. This enables your workflows to incorporate intelligent analysis, content generation, and decision-making without requiring custom code.

Key Benefits

This action transforms basic automation into intelligent, decision-based processes. Key advantages include:

  • Enhanced Logic: Automate complex tasks like summarizing information, qualifying leads, or generating personalized content based on workflow context.
  • Structured Output: Configure agents to return data in a consistent format (like JSON) that can be easily used for field updates, branching logic, or sending to other systems.
  • Seamless Integration: Use the agent's output directly in subsequent workflow steps, such as in emails, SMS, internal notes, or conditional branches.

Prerequisites

Before you can add this action, ensure the following:

  • You have an active subscription that includes access to the AI agent builder.
  • The specific AI agent you intend to use is published to its Production environment. Agents saved only as drafts or in staging will not be available for selection in the workflow.
  • You have the necessary permissions to edit workflows and manage AI agents within your location.

Important Pre-Setup Note

For the smoothest experience, the AI agent should be built using the Workflows trigger type within the agent builder. This trigger is specifically designed for agents that will be launched from a workflow, ensuring inputs are passed correctly and the response is formatted for use in subsequent automation steps.

Configuring the Action

To add and configure the action in your workflow:

  1. In the workflow builder, add the Invoke AI Agent action to your desired step.
  2. In the action settings panel, configure the following fields:
    • Agent (Required): Select your published Production agent from the dropdown list.
    • Message (Optional): Provide primary instructions for the agent. You can use merge fields here to include dynamic data from the contact or workflow.
    • Input Variables: Map values from your workflow (using merge fields) or enter static text to the agent's predefined input variables. Ensure all required inputs are provided.
    • Store Output As: Assign a custom variable name to save the agent's full response. You will reference this variable name in later steps to use the output.
  3. Save the action configuration.

Using the Agent's Output

The power of this action lies in using the agent's response to drive further automation. After the agent runs, you can use the stored output variable in downstream workflow steps, such as:

  • Updating a custom field or adding a note to a contact record.
  • Controlling an If/Else branch based on the agent's analysis or classification.
  • Inserting the generated text into an email, SMS, or internal notification.
  • Passing the structured data to a webhook or another integrated application.

Best Practices and Use Cases

Best Practices

  • Provide clear, concise instructions in the Message field and use input variables for detailed, structured context.
  • When the output will be used for logic or data updates, instruct the agent to return its response in a structured format like JSON.
  • Test the agent thoroughly within the AI agent builder to verify its output format and behavior before relying on it in a live workflow.
  • Remember to publish any changes to the agent to Production for the workflow to use the updated version.

Example Use Cases

  • Lead Enrichment: After a form submission, send the lead details to an agent for scoring or categorization, then route the contact accordingly.
  • Conversation Summary: When a chat conversation ends, invoke an agent to create a summary and save it to the contact's record.
  • Content Generation: Use an agent to draft a personalized follow-up email or social media post based on a contact's recent activity.
  • Data Structuring: Have an agent parse free-text survey responses and output standardized data for reporting or segmentation.