When to use
- Keep a status that other items read, such as
openorclosed - Remember when something last ran, so the next run knows where to start
- Count how many requests came in today
- Switch a behavior for the agent’s conversation flows and coworkers
Fill in the step
The value must fit the variable’s type. A number variable refuses text, and a date variable refuses a value that isn’t a date. The group can’t be
environment: that name is reserved.
The step changes a variable that already exists. It can’t set a Secret: only people set secrets.
What it gives back
Use them in later steps, for example
{{update_agent_variable_1.value}}.
Example: remember the last run
1
Do the work
A scheduled workflow fetches new orders.
2
Save the time
Add an Update Agent Variable step. Pick the Variable group
Sync, the Variable last_run, and the Value {{start_1.date}}.3
Read it next time
The first step of the next run asks only for orders after
{{agent.Sync.last_run}}.Good to know
- Every change goes to the group’s History, under the workflow’s name.
- A workflow of another agent can’t change this agent’s variables.
- Changing a group’s key, or renaming the variable, rewrites the step for you.
Next steps
Agent variables and secrets
Types, history and secrets.
Update Variable
Remember something for one run.
