Skip to main content
Parakeet Logo

🦜🔀 Parakeet Workflows

High performance and flexible event-driven workflow engine, designed to build complex tasks.

Testing PyPI - Version Downloads PyPI - License Ruff

✨ Highlight features

  • Event-driven execution — Steps communicate through typed events.
  • Fan-out / Fan-in — Emit multiple events in parallel and join results back, with full async support.
  • Shared state — Pass data across steps via a built-in Context object without global variables.
  • Internal buffer — Events are queued internally, so steps can produce and consume at their own pace.
  • Declarative API — Define steps with a simple @step decorator.
  • Built-in observability — Instrument workflows with OpenTelemetry-compatible tracing and custom metrics.

📦 Installation

pip install parakeet-workflows

With uv:

uv add parakeet-workflows

🚀 Quickstart

Here's a simple example to get you started with Parakeet Workflows:

import asyncio
from parakeet_workflows import Workflow, Context, step
from parakeet_workflows.events import Event, StartEvent, StopEvent


class MessageEvent(Event):
    message: str

class MyWorkflow(Workflow):

    @step(when=StartEvent)
    async def start(self, ctx: Context, ev: StartEvent) -> MessageEvent:
        input_msg = ev.get("message", "")
        return MessageEvent(message=f"Processed: {input_msg}")

    @step(when=MessageEvent)
    async def process(self, ctx: Context, ev: MessageEvent) -> StopEvent:
        return StopEvent(result=ev.message)


async def main():
    workflow = MyWorkflow()
    result = await workflow.run(input_msg="Hello, World!")
    print(result)

asyncio.run(main())

Core Concepts

Workflow

A workflow is a class that inherits from Workflow and contains one or more steps. It orchestrates the execution of steps based on events.

Steps

Steps are asynchronous methods decorated with @step(when=EventType) that define what happens when a specific event is received.

  • Steps receive a Context and an Event.
  • Steps can return new events to trigger subsequent steps.

Events

Events are the building blocks of workflows. They carry data between steps and trigger step execution.

  • StartEvent: Automatically triggered when a workflow starts
  • StopEvent: Signals the end of a workflow and carries the final result
  • Custom Events: Define your own events by inheriting from Event

Context

The Context object provides access to workflow state and allows steps to share data throughout the workflow execution.

# Read-only access
current_value = ctx.state.count

# Edit state
async with ctx.store.edit_state() as state:
    state.count = current_counter + 1

# Send events
ctx.send_event(MyEvent(...))

Server

Parakeet Workflows includes an optional HTTP server built on FastAPI that exposes your workflows as REST endpoints.

import asyncio
from parakeet_workflows.server import WorkflowServer

server = WorkflowServer()
server.add_workflow("my-workflow", MyWorkflow())

asyncio.run(server.serve(host="0.0.0.0", port=8080))
Endpoint Description
GET /workflows List all registered workflows
POST /workflows/{id}/run Execute a workflow

License

Apache License 2.0

Metadata

Release files for parakeet-workflows 0.1.0

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

Source distribution (sdist)

Source distribution for parakeet-workflows 0.1.0
File Size Uploaded Provenance Actions
parakeet_workflows-0.1.0.tar.gz 30.4 kB Without provenance Details for parakeet_workflows-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parakeet-workflows 0.1.0
File Interpreter ABI Platform Actions
parakeet_workflows-0.1.0-py3-none-any.whl Python 3 none any Details for parakeet_workflows-0.1.0-py3-none-any.whl

Total release size: 71.3 kB

Release files / parakeet_workflows-0.1.0.tar.gz

Download URL parakeet_workflows-0.1.0.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cf85838925d4a7f23bcee0efe201a0098e291f8e80a72045ca176b0e8a77efab
BLAKE2b-256 checksum
How to use checksums
5bfb169add3c06bbc3eae3c118cade971a14cc386acfcdbb99cb4e14325899b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / parakeet_workflows-0.1.0-py3-none-any.whl

Download URL parakeet_workflows-0.1.0-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcf1e0fceafa81a777189ee4fbbcb9348b215afaf9176a2fb817f74593868576
BLAKE2b-256 checksum
How to use checksums
932c0d1db088610f1670426d107623871c2c7c76717f53efdfd4b4be0debb60d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for parakeet-workflows 0.1.0

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.1.0 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