Skip to content

AutoFlow (Router workflow) #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks
jenna-winkler opened this issue Apr 29, 2025 · 0 comments
Open
4 tasks

AutoFlow (Router workflow) #803

jenna-winkler opened this issue Apr 29, 2025 · 0 comments
Assignees
Labels
python Python related functionality typescript Typescript related functionality

Comments

@jenna-winkler
Copy link
Contributor

jenna-winkler commented Apr 29, 2025

Description

This issue tracks the implementation of a workflow pattern where a Delegator step dynamically determines the next step to execute based on context or input intent. This pattern allows routing between different models/tools and can optionally return a final result directly to the user.

This approach enables:

  • Dynamic control flow within workflows
  • Modular task-specific steps using different models
  • Returning to the Delegator for coordination after each step

Context

Originally discussed in Github Discussion #793

Next actions

  • Implement the example in Python
  • Update docs
  • Review docs

(Nice to have)

  • Create a TypeScript version if time permits

Implementation

Autoflow is a workflow engine where an LLM determines which functions to execute and in what order. Instead of having predetermined execution paths, the LLM acts as a router that decides the next step based on:

  • The current state
  • Available functions
  • The user's request

How it works

  1. Register functions as workflow steps
  2. User provides a task
  3. LLM examines available steps and current state
  4. LLM decides which step to run next and what parameters to use
  5. System executes the selected step
  6. Process repeats until completion (when LLM calls the "final_answer" step)

Core components

  • Autoflow Class is the main class for creating and executing workflows
  • AutoflowState tracks the workflow's current execution state

Autoflow uses two main templates to guide the LLM:

  • Router Template - used to help the LLM decide which step to run next
  • Response Template - formats action results in the conversation

Example

https://github.com/i-am-bee/beeai-framework/tree/feat/803-autoflow-example/python/examples/workflows/custom/autoflow

@jenna-winkler jenna-winkler moved this to Backlog in BeeAI Framework Apr 29, 2025
Tomas2D added a commit that referenced this issue May 6, 2025
Ref: #803
Signed-off-by: Tomas Dvorak <[email protected]>
Tomas2D added a commit that referenced this issue May 6, 2025
Ref: #803
Signed-off-by: Tomas Dvorak <[email protected]>
@ajbozarth ajbozarth added python Python related functionality typescript Typescript related functionality labels May 9, 2025
@jenna-winkler jenna-winkler changed the title Add example workflow with "Delegator" step that dynamically routes to other steps AutoFlow May 20, 2025
@jenna-winkler jenna-winkler changed the title AutoFlow AutoFlow (Router workflow) May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python related functionality typescript Typescript related functionality
Projects
Status: Backlog
Development

No branches or pull requests

3 participants