Skip to main content

FlowFn Python SDK

Distributed job queues, event streams, and workflow orchestration for Python.

Features

  • Queues: Background job processing with retries, priorities, and batch processing
  • Streams: Pub/sub event streaming with consumer groups and replay
  • Workflows: Multi-step orchestration with state management and compensation
  • Patterns: Rate limiting, batching, priority queues, circuit breakers
  • Storage: Pluggable storage backends (Memory, Redis, PostgreSQL)
  • Monitoring: Health checks, metrics, and event tracking

Installation

pip install flowfn

With optional adapters:

pip install flowfn[redis]     # Redis adapter
pip install flowfn[postgres]  # PostgreSQL adapter
pip install flowfn[all]       # All adapters

Quick Start

Queue Example

from flowfn import create_flow

flow = create_flow(adapter='memory')

# Create a queue
queue = flow.queue('emails')

# Add jobs
await queue.add('send-welcome', {
    'to': 'user@example.com',
    'template': 'welcome'
})

# Process jobs
@queue.process()
async def process_email(job):
    await send_email(job.data['to'], job.data['template'])
    return {'sent': True}

Stream Example

# Create a stream
stream = flow.stream('events')

# Publish events
await stream.publish({
    'type': 'user.created',
    'user_id': '123'
})

# Subscribe to events
@stream.subscribe()
async def handle_event(message):
    print(f"Received: {message.data}")
    await message.ack()

Workflow Example

# Define a workflow
workflow = (
    flow.workflow('process-order')
    .step('validate', validate_order)
    .step('charge', charge_payment)
    .step('fulfill', fulfill_order)
    .build()
)

# Execute workflow
execution = await workflow.execute({
    'order_id': '123',
    'amount': 99.99
})

Documentation

Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black flowfn tests

# Type checking
mypy flowfn

License

MIT

Metadata

Release files for flowfn 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowfn 0.0.1
File Size Uploaded Provenance Actions
flowfn-0.0.1.tar.gz 25.9 kB Without provenance Details for flowfn-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flowfn 0.0.1
File Interpreter ABI Platform Actions
flowfn-0.0.1-py3-none-any.whl Python 3 none any Details for flowfn-0.0.1-py3-none-any.whl

Total release size: 56.6 kB

Release files / flowfn-0.0.1.tar.gz

Download URL flowfn-0.0.1.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d7020e17eb12a6fef3a325703e6298690fefd5be0f79660625863433389cb546
BLAKE2b-256 checksum
How to use checksums
6d4281dffb1883ab282be451204219ea0b92c2a98c91f7bfc6b1b01cf34a8b36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / flowfn-0.0.1-py3-none-any.whl

Download URL flowfn-0.0.1-py3-none-any.whl
Size 30.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5866cbd5d8120ee4b0e4b54d8e79e4fca643cc735adfaa1d6c5d4ff77b6837bf
BLAKE2b-256 checksum
How to use checksums
9e39ae07f3f1d2c6c8304b1013ee75c4d186b6d72cd8c4572bb9fc1184b37704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for flowfn 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page