Skip to main content

Workflow Action: Invoke Agent in Agent Studio

Use the Invoke Agent in Agent Studio workflow action to send workflow context to a published Agent Studio agent, receive the agent’s response, and continue the automation using that result.

What Is Invoke Agent in Agent Studio?

Invoke Agent in Agent Studio is a workflow action that runs a selected Agent Studio agent when a contact reaches that step in a workflow. The workflow can send instructions and workflow data to the agent. The agent processes that information in the background and returns a response that can be used by downstream workflow actions. This allows a single automation to combine standard workflow logic with AI-generated or AI-analyzed results.


How the Agent Studio Workflow Action Works

When a workflow reaches Invoke Agent in Agent Studio:

  1. The workflow sends the configured message and mapped inputs to the selected agent.

  2. The Agent Studio agent processes the request.

  3. The agent returns its response.

  4. The workflow continues to the next action.

  5. The returned result can be reused by supported downstream workflow actions.

The agent should be designed for workflow invocation before it is added to the workflow.


What You Can Do With the Agent Response

The returned response can support additional automation after the agent finishes processing. Depending on how the workflow is configured, you can use the result to:

  • Add AI-generated information to a later message.

  • Store a summary or classification.

  • Update records or fields.

  • Make an If/Else decision.

  • Create internal notifications.

  • Send information to another system through a webhook.

  • Pass AI-generated context to later workflow actions.

For automation that depends on specific values, design the agent to return predictable structured output.


Before You Set Up the Action

Before adding Invoke Agent in Agent Studio to a workflow, confirm the following:

  • You have access to Agent Studio.

  • You have permission to create or edit the required AI agent.

  • You have permission to create or edit workflows.

  • The agent is configured for workflow invocation.

  • The agent is published to Production before you try to select it from the workflow action.

Agents that are not eligible for workflow invocation may not appear in the workflow action selector.


How to Open Agent Studio

  1. Select AI Agents from the main navigation.

  2. Select the Agent Studio tab.

The Agent Studio page displays the agents available in the current account.


How to Create or Open an Agent

From AI Agents → Agent Studio, you can either create a new agent or edit an existing one.

  1. To create an agent, click Create Agent.

  2. To modify an existing agent, select the agent from the Agent Studio list.

Use an existing agent only if it is intended to be invoked from a workflow and its configuration matches the data the workflow will provide.


How to Configure the Agent for Workflow Invocation

The agent’s start trigger determines how it can be launched. For an agent that will run through the Invoke Agent in Agent Studio workflow action:

  1. Open the agent in Agent Studio.

  2. Add or edit the Start trigger.

  3. Select Workflows as the trigger.

  4. Configure the agent’s instructions, nodes, tools, and required inputs.

  5. Test the agent.

  6. Publish the completed agent to Production.

The Workflows trigger is specifically intended for agents that are launched by a workflow.


How to Add the Agent Studio Action to a Workflow

  1. Go to Automation → Workflows.

  2. Open an existing workflow or create a new workflow.

  3. Add or configure the workflow trigger that determines when contacts should enter.

  4. Click + Add at the point where the Agent Studio agent should run.

Add the Agent Studio action at the exact point where the agent needs access to the workflow’s current data and context.


How to Select Invoke Agent in Agent Studio

After clicking + Add:

  1. Open the workflow action list.

  2. Locate the Agent Studio section.

  3. Select Invoke Agent In Agent Studio.

The action configuration panel opens after the action is selected.


How to Configure the Action Name

The Action Name identifies this step inside the workflow. Use a descriptive name when the workflow contains multiple AI-related actions.

Examples include:

  • Lead Message Analyzer

  • AI Conversation Summary

  • Sales Insight Generator

  • Lead Qualification Agent

  • Internal Handoff Summary

Changing the action name helps organize the workflow but does not change how the selected Agent Studio agent behaves.


How to Select the Agent

The Select Agent field determines which Agent Studio agent runs when the workflow reaches this action.

  1. Open the Select Agent dropdown.

  2. Choose the required agent.

Only eligible agents available to the current account can be selected. If the agent you need is missing, verify that it is configured correctly for workflow invocation and published to Production.


How to Configure the Message

The Message field provides instructions or context for the agent when the workflow invokes it. You can use:

  • Static instructions.

  • Workflow-specific context.

  • Supported dynamic values or merge fields.

For example: Summarize the recent conversation with {{contact.name}} and recommend the next best action.

Keep the message focused on the task the agent must perform. Additional contact-specific or workflow-specific data can be supplied through supported dynamic values and configured inputs.


How to Configure Input Variables

If the selected agent defines input variables, map each required input to the appropriate workflow value. Input variables allow the same Agent Studio agent to process different data each time it runs. For each required input:

  1. Identify the corresponding input defined by the agent.

  2. Map a workflow value or supported static value to that input.

  3. Confirm all required inputs have values before saving the action.

Missing required inputs can prevent the action from completing successfully.


How to Store the Agent Output

When the action provides an option to store its result, use Store Output As when later workflow actions need the complete response. Stored output can be useful when you need to:

  • Reference the response later in the workflow.

  • Save an AI-generated summary.

  • Pass results to another action.

  • Update a record.

  • Evaluate AI-generated values with workflow conditions.

The output you store should match how later actions are expected to consume it.


How to Use Agent Output in Later Workflow Steps

The primary value of this action is the ability to continue the workflow using the agent’s result. Common downstream patterns include:

  • Insert the returned text into an internal notification.

  • Add the response to a note or field.

  • Include the response in an Email, SMS, or WhatsApp message.

  • Evaluate a returned value with If/Else logic.

  • Send the response through a webhook.

  • Pass the result to another workflow action.

Design the agent’s response format around what the next workflow action needs.


When to Use Plain Text Output

Use plain text when a later action only needs human-readable content. Examples include:

  • Conversation summaries.

  • Internal notes.

  • Suggested responses.

  • Sales recommendations.

  • Email content.

  • Internal notifications.

Plain text is usually appropriate when no automated decision needs to be made from individual values in the response.


When to Use Structured Output

Use structured output when the workflow needs to evaluate or reuse individual values from the response. For example, an agent could return values representing:

  • Lead qualification status.

  • Priority.

  • Recommended owner.

  • Intent.

  • Category.

  • Next action.

Structured JSON is generally more appropriate than free-form text when later workflow actions depend on predictable machine-readable values.


Example: Conversation Summary Workflow

A workflow can use Agent Studio to prepare an internal summary automatically.

Example flow:

  1. A workflow starts after a relevant contact event.

  2. Invoke Agent in Agent Studio sends the latest contact context to a summary agent.

  3. The agent returns a short summary and recommended next action.

  4. The workflow stores or references the returned result.

  5. A later action sends the summary to the appropriate team member.

This pattern allows the workflow to turn raw contact activity into actionable internal context automatically.


Example: Lead Qualification Workflow

An Agent Studio agent can classify a lead before the workflow chooses the next path. Example flow:

  1. A lead submits a form.

  2. The workflow sends the submitted information to the agent.

  3. The agent evaluates the lead.

  4. The agent returns structured qualification information.

  5. An If/Else step evaluates the result.

  6. Qualified and unqualified leads follow different workflow paths.

For this use case, structured output is preferable because the workflow depends on predictable values.


Best Practices

Use a clear action name so other users can identify the purpose of the AI step from the workflow canvas. Keep the Message focused. Put reusable or dynamic information into mapped variables when supported instead of building an unnecessarily long instruction. Test the expected agent response before using it in important downstream automation.

Use structured output when the workflow must make a decision based on the agent’s response. Make sure required agent inputs are mapped before publishing the workflow. Publish agent changes to Production before expecting those changes to be available to workflow invocation. When a workflow uses multiple Agent Studio actions, give each action a different descriptive name so execution logs are easier to interpret.


Common Issues and Fixes

My agent does not appear in the Select Agent dropdown

Verify that the agent is available in the current account and has been published to Production. Also confirm that the agent was configured for workflow invocation using the Workflows trigger. Reopen the workflow action after publishing the agent if necessary.

The Agent Studio action fails when the workflow runs

Check whether the agent requires input variables. Every required input must receive a valid value when the workflow invokes the agent. Also review the workflow execution logs and Agent Studio testing information to identify where the run failed.

The agent response cannot be used reliably in an If/Else branch

Free-form text can vary between executions. Configure the agent to return predictable structured output when the workflow must evaluate specific values.

The agent is returning the wrong information

Review:

  • The Message configured in the workflow action.

  • The data mapped into the agent.

  • The agent’s instructions.

  • Required input variables.

  • The expected response format.

Test the agent with representative data before relying on the result in a published automation.

Changes to my agent are not appearing in the workflow

Confirm the latest agent version has been published to Production. The workflow should invoke the production-ready version of the agent rather than an unpublished editing version.

FAQ

Why doesn’t my agent appear in the dropdown?

The agent must be eligible for workflow invocation and available in the current account. Confirm that it uses the Workflows trigger where required and is published to Production.

Can one workflow invoke multiple Agent Studio agents?

Yes. A workflow can contain multiple Invoke Agent in Agent Studio actions. You can place the actions sequentially or use them in different workflow branches.

Does the agent run automatically when a contact reaches this step?

Yes. When the workflow reaches the Invoke Agent in Agent Studio action, the configured agent runs using the information supplied by that action.

What happens if the agent returns an error?

The workflow action can fail when the agent cannot complete the run. Review the workflow execution logs and the agent’s testing or debugging information to determine the cause.

Can I use contact information in the Message field?

Yes. The Message field can use supported dynamic values to provide contact-specific or workflow-specific context to the agent. For example, the message can reference a contact name when that value is available in the workflow.

Should my agent return plain text or JSON?

Use plain text when the response is intended for a person to read, such as a summary or message. Use structured JSON when the workflow needs to evaluate individual values, update records predictably, branch with conditions, or send structured data to another system.

Can I save the agent response for later workflow steps?

Yes, when the action provides output storage or response values that can be referenced downstream. Saving the result is useful when multiple later actions need the same Agent Studio response.

Can I invoke the same agent from different workflows?

Yes. An eligible Agent Studio agent can be reused wherever its inputs, instructions, and expected output are appropriate for the workflow.

How should I troubleshoot input-variable problems?

Compare the agent’s required inputs with the values mapped in the workflow action.

Then review the workflow execution logs and test the same inputs directly in Agent Studio to identify missing, invalid, or unexpected values.

Do I need custom code to invoke an Agent Studio agent from a workflow?

No. The Invoke Agent in Agent Studio workflow action is designed to connect workflows with Agent Studio without requiring custom code.

Did this answer your question?