Agent Step
Run AI inside a workflow, with instructions you write in the Step or a saved agent you've already built, and choose what each Agent step knows.
Put AI to Work Inside a Workflow
An Agent step is where a workflow does its thinking: it drafts the brief, scores the answers, suggests the angles. Each one runs AI with your instructions, the knowledge you attach and what happened earlier in the run. You write the instructions in the Step, or point the Step at an agent you've already built. Your Members don't see the Step itself. They see its result, or they watch the progress list while it works.
Add an Agent Step
If Spark built the workflow, go back to its Spark session and say what the new Step should do and where it goes, for example: "After the questions, add a step that turns the answers into a one-page brief." Spark writes the Step's instructions, chooses its model and can turn on Pause for Human Review and Save as Asset. See Refining a Tool With Spark.
An Agent step Spark adds always holds its own instructions. To run a saved agent instead, add that Step yourself once you're done asking Spark for changes.
Add the Step
In the workflow editor, click Agent in the Agent group of the Steps list. ThoughtFlow connects it at the end of the workflow.
Choose the mode
Under Mode, keep Inline to write the instructions here, or click Saved Agent to run an agent you've built. See Choose Inline or Saved Agent.
Set it up
Fill in the settings for the mode you chose, then click Preview to try it. See Testing and Publishing a Workflow.
If Spark built this workflow, a later Spark change replaces every Step, including an Agent step you add or edit here. See What a Spark Change Replaces.
Choose Inline or Saved Agent
| Mode | What the Step runs | Use it when |
|---|---|---|
| Inline | Instructions, a model and knowledge you set on this Step. New Agent steps start here. | The work belongs to this workflow only. |
| Saved Agent | An agent from your Agents list, with its instructions, model and knowledge. | You've already built an agent that does the job, and you want to reuse it here. |
Switching from Saved Agent to Inline starts the Step on ThoughtFlow's default model if it has none. Switching to Saved Agent clears the Step's own instructions and model.
Set Up an Inline Agent Step
Click the Step to open its settings. Below the settings every Step has:
| Setting | What it does |
|---|---|
| Model | The AI model the Step uses. New Agent steps start with ThoughtFlow's default model. |
| Web Search | Lets the Step search the web while it works. Set Max Searches per Run, from 1 to 10. It starts at 5. Each search uses Credits, and it works only with some models. |
| Agent Instructions | What the Step should do, how, and what a good result looks like. Click Insert Variable to add your Member's answers, the results of earlier Steps or the User Knowledge fields you attached. |
| Knowledge Sources | What the Step knows besides its instructions. Click Manage Knowledge Sources to attach it. See Attach Knowledge. |
Model and Web Search work the same way they do on a saved agent. See Choose the Model and Web Search.
Write the Instructions
Write them the way you'd brief a skilled assistant: who the Member is, what they've given you, what to produce and your rules for it. For example: "Write a one-page brief for this client. Use their goals as the headings. Keep it under 400 words."
Insert the answers the Step must work from. Click Insert Variable and choose them under Input Fields. If the instructions use a variable that no earlier Step or attached field defines, a warning below them says Unresolved variable (or Unresolved variables). See Variables.
When a variable has no value at run time, such as an answer from a branch the run didn't take, the AI receives the variable's name in curly brackets instead of an answer. Make sure each variable comes from a Step the run always passes through.
What the Step Receives
Each time the Step runs, ThoughtFlow sends the AI:
-
Your instructions, with the variables filled in.
-
The Knowledge Library items you attached.
-
Today's date, in your Member's time zone.
-
About the Member: the User Knowledge fields you attached, with this Member's values.
-
The result of each Step directly before this one, whatever its type. A Compute Step's number and a Condition Step's true or false come through this way too.
-
Earlier Step results you attached under Prior Step Outputs.
-
The Member's answers from the questions the workflow starts with.
Answers to a Human Input Step later in the workflow reach the AI only where you insert them as variables. Insert every answer the Step needs, and you never have to wonder whether it arrived.
Attach Knowledge
Click Manage Knowledge Sources. The Knowledge Sources window has three tabs:
| Tab | What you attach |
|---|---|
| Agent Knowledge | Items and tags from your Knowledge Library. The same for every Member. |
| User Knowledge Fields | Each Member's own profile fields. An attached field also appears under User Knowledge in Insert Variable. |
| Prior Step Outputs | The full result of any earlier Step, not only the one directly before this one. |
Prior Step Outputs lists the Steps this Step already receives under "This step already receives the following automatically." Attach an earlier Step when this one needs its result but isn't connected straight to it. For example, a Follow-Up Email Step three Steps after Draft Brief can attach Draft Brief. If your Member edited that result at a Human Review pause, the Step gets their edited version.
What you attach is listed under Knowledge Sources on the panel, marked Agent, User or Step. Agent Knowledge and User Knowledge Fields work the same way they do on a saved agent. See Agent Knowledge.
Use a Saved Agent
Click Saved Agent under Mode. The Step runs an agent from your Agents list, so you build and improve it in one place.
Choose the agent
Under Target Agent, choose from Select an Agent. The list shows every agent in your App, form and chat agents both, including drafts.
Decide how it follows changes
Under Sync Mode, leave Always Use Latest Version on to use the agent as it is each time the workflow runs. Turn it off to freeze the agent as it is now. See Always Use Latest Version.
Add knowledge if this workflow needs more
Under Additional Knowledge Sources, click Manage Knowledge Sources. What you attach here is added to the agent's own knowledge, not used in place of it.
What the Step Uses From the Agent
The Step uses the agent's instructions, model, knowledge and Web Search setting. For a form agent, Web Search shows on the Step, but you change it in the agent.
Everything else comes from the workflow:
- Answers come from the workflow's Steps, not the agent's own input fields. If the agent's instructions insert its own input fields, those come out unfilled in the workflow. Write such agents to work from the answers and Step results they're given.
- Save To Profile rows on the agent don't run inside a workflow. Use a Save to Profile Step or the workflow's Save Outputs to Member's User Knowledge setting instead. See Save to Profile Step.
- Output Name and Number of Outputs don't apply. The Step writes one result, and Asset Name on the Step names its Asset. See Step Types.
Always Use Latest Version
| Setting | What the Step runs |
|---|---|
| Always Use Latest Version on | The agent as it is at the moment the workflow runs. Change the agent, and every run after that uses the change. |
| Always Use Latest Version off | A copy of the agent's instructions, model and Web Search setting, taken when you turned it off. The panel shows "Snapshot captured." and when it was taken. |
With it off, when someone changes the agent, the panel says "The referenced agent has changed since the last snapshot." Click Update to Latest to take a new copy.
Turn it off when the workflow is live and you want to try changes to the agent without changing what your Members get. When you're happy with the agent, click Update to Latest.
A Step that runs a chat agent always uses the agent as it is. Always Use Latest Version has no effect on it.
Run a Chat Agent in a Workflow
When the Target Agent is a chat agent, the run stops at the Step and your Member chats with the agent inside the workflow. When they're done, they click Continue. The whole conversation becomes the Step's result for the Steps after it.
The chat agent starts out knowing what happened earlier: your Member's answers to earlier questions, the results of the Steps directly before it and anything you attached under Prior Step Outputs.
These settings appear for a chat agent:
| Setting | What it does |
|---|---|
| Opening Message | The first message your Member sees, up to 500 characters. Leave it blank to use the agent's Welcome Message. Click Insert Variable to add results of earlier Steps, built-in variables such as First Name, or text profile fields, with a Fallback (Optional) for Members who have no value. |
| Agent Speaks First | The agent writes the first message itself, using what happened earlier in the workflow. |
| Conversation Starters | Off, Agent's Starters, This Step's Starters or AI-Suggested from Earlier Steps. |
| This Step's Starters | Up to 5 starters for this Step, each up to 100 characters. With AI-Suggested from Earlier Steps, they show when suggestions can't be written. |
AI-Suggested from Earlier Steps writes up to 3 starters for each Member from what happened earlier in the workflow. It makes one AI call for each Member, which uses Credits. Starters disappear once your Member sends their first message.
A Step that runs a chat agent doesn't have Pause for Human Review. Your Member is already talking with it. See Chat Agent Settings for the settings that come from the agent.
Use the Step's Result Later
The panel's last section shows the Step's variable, such as {{draft_brief}} for a Step named Draft Brief. Insert it in a later Step under Step Outputs in Insert Variable. See Variables.
The variable's name comes from the Step Name. If you rename a Step, update the Steps that use its variable. The old variable no longer finds anything.
With Pause for Human Review on, later Steps get the result your Member approved, with their edits. See Human Review. To keep the result, turn on Save as Asset. See Step Types.
Fix Agent Step Warnings
| What you see | What to do |
|---|---|
| "Add agent instructions to this Agent step before publishing." | Write the Step's Agent Instructions. |
| "Select a model for this Agent step before publishing." | Choose the Step's Model. |
| "Select an agent for this step before publishing." | In Saved Agent mode, choose a Target Agent. |
| "This step has no dynamic input. Add a merge field to the agent instructions or configure a Human Input step." | The Step doesn't use anything your Member gave you. Insert an answer, or add a Human Input Step before it. This one doesn't stop you from publishing. |
| "This model has been deprecated. Select a new model to continue." | The Step's model is being retired. Choose a new one. Until you do, the Workflows list shows "Uses deprecated model. Please update.", and anyone who opens the workflow, your Members included, sees Tool Unavailable. |
See Testing and Publishing a Workflow.
Every Agent step run uses Credits, and so does each web search. See Credits.