How to Define a Flow?
Last updated
Last updated
Defining a flow involves setting up a series of interconnected steps that guide the agent’s actions. This guide outlines the process of creating and configuring a flow, from initial setup to finalization.
1. Navigate to the Define Flow Page
Upon navigating to the Define Flow page, you will see two default components:
Input: Defines how data enters the flow. This data is automatically carried over from the Create Queue step. No user action is needed to modify or remove this component.
HTTP: Manages output or communication via APIs. To configure the dashboard, you can create a markdown in the body and define what you want to display as the final output on the agent dashboard.
Note: These pre-configured static components should remain unchanged. You can build your logic around them by adding additional elements.
To create the logic:
Click the '+' icon between the default elements to add new components to your workflow.
Choose components from two categories:
Core Components: Includes programming logic and helper methods.
App Actions: Integrates third-party tools like Amazon S3, Slack, JIRA, and Google Sheets.
Use the search bar to locate your desired component quickly.
The following section demonstrates the process for integrating existing core components and app actions into your workflow.
Adding a Core Component
Adding Files Helper
Search for Files Helper in the search bar or locate it at the bottom of the list.
Click on it to add it to the flow.
Choose an action for the Files Helper:
Read File: Reads a file from the file system. Input the file or insert data from previous steps and define the output format (e.g., text or Base64).
Create File: Creates a file from content. Provide the file name or insert data from previous steps and select an encoding method.
Change File Encoding: Changes a file's encoding. Provide the source file or data from previous steps, specify the source encoding, and input the output file name and encoding method.
Connecting a Third-party Tool
Adding Asana
Click Asana to connect it.
Select an action:
Create a Task: Create a new connection or use an existing one. Fill in required fields like Workspace, Project, Task Name, Description, Due Date, Tags, and Assignee.
Custom API Call: Create a new connection or use an existing one. Add the URL, Request Method, Headers, Query Parameters, and Timeout.
Adding ZBrain to the Flow
Search for ZBrain in the search bar and select it.
Choose an action:
Knowledge Bases: Search within uploaded knowledge bases and retrieve data.
Select one or multiple knowledge bases.
Add a query or use data from previous steps.
Configure additional settings like Maximum Tokens, Response Format (JSON/String), Document Summarization, or Meta-information.
Apps: Query connected applications.
Select the app you want to query.
Add a query or data from previous steps.
Input the conversion ID for efficient retrieval.
Models: Interact with LLMs for various tasks.
Select a model from the list (including multimodal models).
Input parameters like temperature and maximum tokens.
Models: Interact with LLMs for various tasks.
Agent: Trigger a specific agent to perform tasks.
Select an agent and input the required URL.
ZBrain Connection Setup:
Use an existing connection or click ‘+ New Connection.'
Provide a name and enter your API key.
Retrieve the API key by navigating to Settings > My Account in ZBrain.
Note: Please follow the on-screen prompts and instructions to connect the components and configure them efficiently and accurately.
Each component includes additional options:
Continue on Failure: Enable to skip the step and proceed with the flow even if it fails.
Auto Retry on Failure: Automatically retry the step up to four times if it fails.
Once all steps are configured:
Review your flow to ensure all steps are correctly configured.
Click ‘Save’ to publish the flow.
For more complex use cases, combine core components with app actions to integrate advanced logic and third-party tools seamlessly. This allows you to design highly customized workflows tailored to your business needs.