Skip to main content

AbstractGateway: deployable Run Gateway host for AbstractRuntime (commands + ledger).

Project description

AbstractGateway

AbstractGateway is the deployable Run Gateway host for AbstractRuntime runs:

  • durable command inbox
  • ledger replay/stream
  • security baseline (token + origin + limits)

This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).

What it does (contract)

  • Clients act by submitting durable commands: start, resume, pause, cancel, emit_event
  • Clients render by replaying/streaming the durable ledger (cursor-based, replay-first)

Endpoints:

  • POST /api/gateway/runs/start
  • GET /api/gateway/runs/{run_id}
  • GET /api/gateway/runs/{run_id}/ledger
  • GET /api/gateway/runs/{run_id}/ledger/stream (SSE)
  • POST /api/gateway/commands

Install

Default (bundle mode)

pip install abstractgateway

Bundle mode executes WorkflowBundles (.flow) via WorkflowArtifacts without importing abstractflow.

Optional (compatibility): VisualFlow JSON

pip install "abstractgateway[visualflow]"

This mode depends on the AbstractFlow compiler library (abstractflow) to interpret VisualFlow JSON (it does not require the AbstractFlow web UI/app).

Run

export ABSTRACTGATEWAY_DATA_DIR="./runtime"
export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles-or-flow"

# Security (recommended)
export ABSTRACTGATEWAY_AUTH_TOKEN="your-token"
export ABSTRACTGATEWAY_ALLOWED_ORIGINS="*"

abstractgateway serve --host 127.0.0.1 --port 8080

Notes:

  • ABSTRACTGATEWAY_WORKFLOW_SOURCE defaults to bundle. Valid values:
    • bundle (default): ABSTRACTGATEWAY_FLOWS_DIR points to a directory containing *.flow bundles (or a single .flow file)
    • visualflow (compat): ABSTRACTGATEWAY_FLOWS_DIR points to a directory containing *.json VisualFlow files
  • For production, run behind HTTPS (reverse proxy) and set exact allowed origins.

Creating a .flow bundle (authoring)

Use AbstractFlow to pack a bundle:

abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows

Starting a run (bundle mode)

The stable way is to pass bundle_id + flow_id:

curl -sS -X POST "http://localhost:8080/api/gateway/runs/start" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-token" \
  -d '{"bundle_id":"my-bundle","flow_id":"ac-echo","input_data":{}}'

For backwards-compatible clients, you can also pass a namespaced id as flow_id ("my-bundle:ac-echo").

Docs

  • Architecture: docs/architecture.md (framework) and abstractgateway/docs/architecture.md (this package)
  • Deployment: docs/guide/deployment.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstractgateway-0.1.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abstractgateway-0.1.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file abstractgateway-0.1.0.tar.gz.

File metadata

  • Download URL: abstractgateway-0.1.0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for abstractgateway-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e77579693f180157a0950ea6913223f9af2a119356e19a71f5188570ddfd9d9
MD5 1253b533082f9900bc13573e10f71672
BLAKE2b-256 4d500034a2745bc371473af7e10545eec538393d31508ce37a897cfcbd6e9b1a

See more details on using hashes here.

File details

Details for the file abstractgateway-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstractgateway-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0da604796d2ff63a5913601d5e79cb22bc180c526d12b6edef397ccd7378ba32
MD5 20faaa5858e3254a7642027664684474
BLAKE2b-256 e07de981ae7ee6da6f486a5d8ddfc87023a7e6840c1eba826ac6c8fa6611d8fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page