Use variables to pass data in your agent

Variables are dynamic placeholders that let you use information from earlier parts of your agent. This lets you create customized and flexible automations.

For example, a variable can take a new Google Form response and insert it into a Google Chat message. Or, you can use the text summarized by Gemini to create a new Google Doc.

Important: When you add variables to third-party integration steps, add-on steps, or the webhook step, they might contain your Google Account data, such as the contents of a message in Gmail or Chat, or event information from Calendar. The agent can then share your Google Account data with a third-party service. Make sure you trust the third-party service.

How to use variables in Workspace Studio

Add a variable

  1. In an agent step, click the text field where you want to add info from a previous step.
  2. If the button shows, click Variables +.
    • Or, type @ to find the variable dropdown menu.
  3. On the dropdown menu, select the starter or output from a previous step you want to use.
    • The variable will be added as a colored chip.

Tips:

  • Some fields only accept certain types of data, like:
    • Email addresses
    • Dates
  • If no compatible variables are available from previous steps, the option to add one may not show.

Examples on how to use variables

  • Notify someone about an email: In a "Send a message" step in Chat, use the "[Sender email address]" variable from your Gmail starter in the recipient field to send them a direct message.
  • Use AI-generated text: You can ask Gemini to summarize a doc and use the "[Gemini summary]" output variable to send that summary in an email.
  • Log and summarize data: When a Google Form is submitted, you can use variables to summarize the responses with Gemini and send the summary to a Chat space.

Related resources

Main menu
12883254506322872857
true
Search Help Center
false
true
true
true
false
false
false
false