Skip to content

Agent Step

The Agent step lets you add AI-powered decisioning and content generation directly into your Canvas workflow. For more general information, see Braze Agents.

An Agent step in a Canvas user journey.

How it works

When a user reaches an Agent step in a Canvas, Braze sends the input data you’ve configured (full context or selected fields) to your chosen agent. The agent then processes the input using its model and instructions, and returns an output. That output is stored in the output variable you defined in the step.

You can then use this variable in two main ways:

  • Decisioning: Route users down different Canvas paths based on the agent’s response. For example, a lead scoring agent might return a number between 1 and 10. You can use this score to decide whether to continue messaging a user or drop them from the journey.
  • Personalization: Insert the agent’s response directly into a message. For example, an agent could analyze customer feedback and generate an empathetic follow-up email that references the customer’s comment and suggests a resolution.

Creating an Agent step

Step 1: Add a step

Drag and drop the Agent component from the sidebar, or select the plus button at the bottom of a step and select Agent.

Step 2: Select your agent

Select the agent that will process data in this step. Choose an existing agent, or create a new one directly from this step. For setup guidance, see Creating custom agents.

Step 3: Define the output variable

Agent outputs are called “output variables” and are stored in a context variable for easy access. To define the output variable:

  1. Give the variable a name.
  2. Select a data type.

Agent outputs can be saved as strings, numbers, or booleans. This makes them flexible for both text personalization and conditional logic in your Canvas. Here are some common uses for each type:

When defined, you can use an output variable throughout the Canvas by using the same template syntax as you would with a context variable. Either use the Context Variable segment filter, or template agent responses directly using Liquid: {{context.${response_variable_name}}} .

Step 4: Decide what context to provide the agent

You must decide what data the agent should receive at runtime. The following options are available:

  • Include all Canvas context: Pass all available Canvas context variables (such as Canvas entry properties) and any other context that it has been given through Context steps.
  • Provide values: Pass only selected properties, such as a user’s first name or favorite color. Choose this option to only give the agent access to the values you assign here. For each Key, enter the Liquid tag that defines the specific user profile field or context variable.

Error handling

  • If the connected model returns a rate limit error, Braze retries up to five times with exponential backoff.
  • If the agent fails for any other reason (such as invalid API key), the output variable is set to null.
  • Responses are cached for identical inputs to reduce repeated invocations.

Analytics

Refer to the following metrics to track how your Agent steps perform:

HOW HELPFUL WAS THIS PAGE?
New Stuff!