4.7. Scenarios for Agents (Creating Workflows)
Agent scenarios (workflows)
At the end of November, we introduced a new feature for configuring agents: the creation of workflows. These allow you to standardize your agents' operational processes, incorporate branching logic and action confirmations, utilize conditions and intermediate messages, and set up specific, additional prompts tailored to various interaction scenarios.
To begin working with scenarios, go to the edit page for your agent (https://tozhebot.ru/admin/collections/agents/) and open the Scenarios tab:
After that, you can configure the workflow you need for a specific agent and situation.
How does this work?
You can now create step-by-step instructions for agents, which can be based either on AI or on traditional, rule-based logic. This is particularly useful for building branching dialogues, bots, and system navigation. Additionally, you can use this feature to collect preliminary information from users by requesting specific data.
For a scenario to work, it must have at least one starting step configured, and it must also be applied to the current agent. To ensure this, don't forget to select the appropriate checkbox and click the corresponding button at the top before saving:
After that, your scripts will work for the current agent for new dialogues.
Types of existing steps
When you create a new script step, you need to specify the step's name, select its type, and optionally add it to a specific group.
There are various types of scenarios:
- Message (sends a specified message to the user, with the option to attach images and action buttons/links).
- Question (requires a user response via button clicks, text input, numeric input, etc. - which is then saved to a variable for later use).
- Condition (evaluates a variable against specific criteria to determine the next steps).
- Action (executes a function from the available tools/MCP servers using parameters provided in JSON format; variables can also be incorporated here).
- AI Dialogue (initiates a conversation with an AI, configured with a specific system prompt, tools, knowledge bases, and allowed images. You can also define a limit on the number of steps, as well as an action to be triggered once those steps are completed).
- Scenario termination, transition to a sub-scenario, or return to the main scenario.
Depending on this, your dialogue can branch off in various directions however you’d like - giving you greater control over the process, without any magic involved.
Switching between steps
Transitions can be configured using buttons or set to trigger automatically upon completion of the current step. You can specify which step the scenario should proceed to next, and group steps together for better organization:
Scenario completion
Once a scenario concludes, the dialogue with the user ends completely; the next message from the user will trigger the scenario to restart from the very beginning. Alternatively, you can avoid a formal conclusion by creating a cyclical structure, where the final step leads directly back to the first step. In this case, the user won’t need to send a new message to return to the start.