Skip to main content

WARNING:

DEPRECATED: This package is deprecated and is no longer maintained. Please consider using alternative solutions for your workflow management needs.

Absurd Python Client

A Python client for the Absurd SQL-based durable execution workflow system. This library provides a Python interface to interact with Absurd's PostgreSQL-based task queue and workflow engine.

Installation

pip install absurd

Quick Start

import psycopg
from absurd_client import AbsurdClient

# Create a client instance
client = AbsurdClient(queue_name="my_queue")

# Connect to your PostgreSQL database and spawn a task
with psycopg.connect("your_connection_string") as conn:
    # Spawn a new task
    task_id, run_id, workflow_run_id = client.spawn_task(
        conn=conn,
        task_name="process_data",
        params={"input": "data"}
    )

    print(f"Spawned task: {task_id}")

    # Claim and process tasks
    claimed_tasks = client.claim_task(conn)
    for task_data in claimed_tasks:
        run_id, task_id, attempt, task_name, params, *_ = task_data

        try:
            # Process the task
            result = {"processed": params}
            
            # Mark as completed
            client.complete_task(conn, run_id, result)
            print(f"Task {task_id} completed successfully")
        except Exception as e:
            # Mark as failed
            client.fail_task(conn, run_id, str(e))
            print(f"Task {task_id} failed: {e}")

Highway DSL Integration

The highway-dsl package provides a Python-based domain-specific language for defining complex workflows that fully supports Absurd:

from highway_dsl import WorkflowBuilder, RetryPolicy
from datetime import timedelta

# Create a workflow with Highway DSL
workflow = (
    WorkflowBuilder("data_pipeline")
    .task("extract", "etl.extract_data", result_key="raw_data")
    .task("transform", "etl.transform_data", args=["{{raw_data}}"], result_key="transformed_data")
    .task("load", "etl.load_data", args=["{{transformed_data}}"])
    .build()
)

# Export to YAML for use with Absurd
print(workflow.to_yaml())

Features

  • Task queuing and processing
  • Event-driven workflow coordination
  • Checkpoint-based state management
  • Retry strategies and failure handling
  • Workflow run tracking
  • Connection pooling for production environments
  • Support for complex workflow patterns

Configuration

The client supports the following environment variables:

  • ABSURD_DEFAULT_QUEUE: Default queue name (default: absurd_default)
  • ABSURD_WORKER_ID: Default worker ID (default: absurd_worker_1)

Support

For support, please open an issue in the GitHub repository.

DISCLAIMER

This package has no affiliation with the original Absurd project or its maintainers. It is an independent implementation designed to work with the Absurd system. Use at your own risk. Also this package is not approved or endorsed by the original Absurd project or its maintainers. I built this as part of HIGHWAY workflow engine, but decided not to use Absurd in the end due to various limitations and issues I encountered in its design and implementation.

Metadata

Release files for absurd 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 absurd 0.1.0
File Size Uploaded
absurd-0.1.0.tar.gz 17.7 kB Details

Built distribution (wheel)

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

Total release size: 35.3 kB

Release files / absurd-0.1.0.tar.gz

Download URL absurd-0.1.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3959000fd1eb3f4bb8114f654cd97f44bfbf01dca5fe8a35ddbf618107091f29
BLAKE2b-256 checksum
How to use checksums
01ac46dd46585199184c78070fc8e0ac790eaa972f541fb1aafd14225c3d50f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

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

Download URL absurd-0.1.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
973e7cd4840dc088d8399616052420ae70bf1cc73f92535f7352e06ca4da73bc
BLAKE2b-256 checksum
How to use checksums
6bc42d6dd75c46e21e8ec47d788067cf21cdcc8accba6a6d6a732888d777d7ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

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