Skip to content

PostGrip Agent — Python SDK

Run shell commands, container workloads, and durable workflows on the PostGrip Agent runtime service from your Python code.

Current release: 0.11.0

Quick start → GitHub PyPI


What this is

A Python library that lets you talk to the PostGrip Agent runtime service. You enqueue tasks (shell commands, containers, workflows, schedules) from a Client, or you run an Agent that picks up tasks and dispatches them to your registered @workflow.defn and @activity.defn functions.

The shape mirrors the Temporal Python SDK on purpose: workflows are async classes decorated with @workflow.defn and @workflow.run; activities are plain async functions decorated with @activity.defn; the agent registers both and runs the polling loop. If you've used Temporal in Python, the surface should feel immediate.

from postgrip_agent import Client, Agent, activity, workflow


@activity.defn
async def greet(name: str) -> str:
    return f"Hello {name}"


@workflow.defn
class SayHelloWorkflow:
    @workflow.run
    async def run(self, name: str) -> str:
        return await workflow.execute_activity(greet, name)

Polyglot

This SDK is one of three. The Go and TypeScript siblings implement the same model against the same wire protocol, so a workflow started by a Python client can be picked up by a Go agent and vice versa.

Where to next

  • Installationpip install and version requirements.
  • Quick start — copy-paste examples for enqueueing tasks and running an agent.
  • Workflow runtime — the durable replay model in depth: history cursor, suspension, determinism rules, sandbox, ContinueAsNew.
  • API — the public surface re-exported from postgrip_agent.