Workflow Discovery
How Bifrost automatically finds and registers your workflows
Workflow Discovery
Section titled “Workflow Discovery”Bifrost automatically discovers workflows and data providers in your workspace. Just write your code with decorators—the platform finds and registers it for you.
How It Works
Section titled “How It Works”When you add a Python file with a @workflow or @data_provider decorator:
- Files stored in S3 - Your workspace files are stored in S3-compatible storage
- API imports on startup - Decorated functions are discovered when the API starts
- Workers stay in sync - File changes are pushed to workers via RabbitMQ
- Your workflow appears - Shows up in the UI and becomes executable
No configuration files, no manual registration—it just works.
Making Your Workflows Discoverable
Section titled “Making Your Workflows Discoverable”Create a Python file anywhere in your workspace
Section titled “Create a Python file anywhere in your workspace”from bifrost import workflow
@workflow(category="communications")async def send_email(recipient: str, subject: str, body: str = ""): """Send email notification to a user.""" # Your code here return {"sent": True}That’s it! The decorator automatically infers:
- name:
"send_email"from the function name - description:
"Send email notification to a user."from the docstring - parameters: from the function signature (types and defaults)
Your workflow now appears in the UI and can be executed.
Data providers work the same way
Section titled “Data providers work the same way”from bifrost import data_provider, context
@data_provider( name="get_licenses", description="Available M365 licenses")async def get_licenses(): # Access context if needed org_id = context.org_id return [ {"label": "Microsoft 365 E3", "value": "SPE_E3"}, {"label": "Microsoft 365 E5", "value": "SPE_E5"} ]Use it in form dropdowns by referencing the data provider name.
Rules for Discovery
Section titled “Rules for Discovery”Your files must follow these simple rules:
- Use the
.pyextension - Only Python files are discovered - Don’t start filenames with
_- Files like_helpers.pyare ignored - Use the
@workflowor@data_providerdecorator - Undecorated functions won’t appear - Import from
bifrost- Usefrom bifrost import workflow
Quick Example
Section titled “Quick Example”Create a file: create_user.py
from bifrost import workflow
@workflowasync def create_user(email: str, first_name: str, last_name: str): """Create a new user account.""" # Your user creation logic return {"success": True, "email": email}Result: Your workflow immediately appears in the Workflows page and can be executed via forms or API.
Workspace Storage
Section titled “Workspace Storage”Workspace files are stored in S3-compatible storage (MinIO locally, AWS S3 in production):
- API and workers sync workspace files to
/tmp/bifrost/workspace - File changes pushed via RabbitMQ to keep all instances in sync
- Horizontal scaling enabled - workers download workspace on startup
This architecture allows you to scale workers independently without shared filesystem requirements.
Common Issues
Section titled “Common Issues”My workflow isn’t appearing
Section titled “My workflow isn’t appearing”- Check your decorator - Make sure you have
@workflowabove your function - Check your imports - Use
from bifrost import workflow - Check your filename - Files starting with
_are ignored (like_helpers.py) - Check for errors - Look at the application logs for import errors
My parameters aren’t showing in forms
Section titled “My parameters aren’t showing in forms”-
Use type hints - Parameters are extracted from the function signature
@workflowasync def test(name: str, count: int = 1):"""Example workflow."""pass -
Make sure types are valid - Use
str,int,float,bool,list, ordict