Skip to content

Workflow Discovery

How Bifrost automatically finds and registers your workflows

Bifrost automatically discovers workflows and data providers in your workspace. Just write your code with decorators—the platform finds and registers it for you.

When you add a Python file with a @workflow or @data_provider decorator:

  1. Files stored in S3 - Your workspace files are stored in S3-compatible storage
  2. API imports on startup - Decorated functions are discovered when the API starts
  3. Workers stay in sync - File changes are pushed to workers via RabbitMQ
  4. Your workflow appears - Shows up in the UI and becomes executable

No configuration files, no manual registration—it just works.

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.

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.

Your files must follow these simple rules:

  1. Use the .py extension - Only Python files are discovered
  2. Don’t start filenames with _ - Files like _helpers.py are ignored
  3. Use the @workflow or @data_provider decorator - Undecorated functions won’t appear
  4. Import from bifrost - Use from bifrost import workflow

Create a file: create_user.py

from bifrost import workflow
@workflow
async 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 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.

  1. Check your decorator - Make sure you have @workflow above your function
  2. Check your imports - Use from bifrost import workflow
  3. Check your filename - Files starting with _ are ignored (like _helpers.py)
  4. Check for errors - Look at the application logs for import errors
  1. Use type hints - Parameters are extracted from the function signature

    @workflow
    async def test(name: str, count: int = 1):
    """Example workflow."""
    pass
  2. Make sure types are valid - Use str, int, float, bool, list, or dict