Skip to main content

httporchestrator

httporchestrator is a small library for explicit multi-step HTTP flows with a single shared state.

Public API

  • Flow defines a flow.
  • RequestStep defines one HTTP request step.
  • ConditionalStep conditionally runs a step.
  • RepeatableStep repeats a step run_while a predicate stays true.
  • CallFlow runs another flow and exports selected state back to the parent.
  • Flow.run() returns a WorkflowRun.

Quick Start

from httporchestrator import Flow, RequestStep

flow = Flow(
    name="echo test",
    base_url="https://postman-echo.com",
    steps=(
        RequestStep("load token")
        .get("/get")
        .params(foo="bar")
        .capture("saved_foo", lambda response, state: response.json()["args"]["foo"])
        .check(lambda response, state: response.status_code == 200, "request should succeed"),
        RequestStep("post extracted value")
        .post("/post")
        .json(lambda state: {"foo": state["saved_foo"]})
        .check(
            lambda response, state: response.json()["json"]["foo"] == "bar",
            "posted payload should contain the captured value",
        ),
    ),
).export(["saved_foo"])

run = flow.run()
assert run.success
assert run.exported["saved_foo"] == "bar"

Step Phases

RequestStep steps execute in a fixed order:

  1. Step-local .state(...) values are resolved against the current flow state.
  2. .before(fn) callbacks can update request-time state.
  3. RequestStep URL, headers, params, body, and JSON are resolved.
  4. The HTTP request is sent.
  5. .capture(...), .after(fn), and .check(...) run in order.
  6. The produced state updates are merged back into the flow state.

Callback contracts:

  • .before(fn) takes state and must return a mapping or None.
  • .after(fn) takes response, state and must return a mapping or None.
  • .capture(name, fn) saves one named value into state.
  • .check(fn, message="") raises ValidationFailure when the assertion returns False or throws.

Nested and Conditional Flows

from httporchestrator import CallFlow, Flow, RequestStep, ConditionalStep

child = Flow(
    name="health check",
    base_url="https://postman-echo.com",
    steps=(
        RequestStep("ping")
        .get("/get")
        .capture("ok", lambda response, state: response.status_code == 200)
        .check(lambda response, state: response.status_code == 200, "health check failed"),
    ),
).export(["ok"])

parent = Flow(
    name="parent",
    steps=(
        CallFlow("run health check").use(child, flow_name="nested health check").export("ok"),
        ConditionalStep(RequestStep("optional ping").get("https://postman-echo.com/get")).run_when(lambda state: state["ok"] is True),
    ),
).export(["ok"])

Runtime Model

  • WorkflowRun.summary contains the overall result.
  • WorkflowRun.session_variables contains the final flow state.
  • WorkflowRun.exported contains only the configured exported values.
  • StepResult.state_updates contains the state written by that step.

Fetchers

Use create_fetcher() for provider auto-detection:

from fetchers.fetcher_registry import create_fetcher
from fetchers.utils import Mode

fetcher = create_fetcher(
    "https://wetransfer.com/downloads/TRANSFER_ID/SECURITY_HASH",
    mode=Mode.INFO,
    save_path="downloads",
)
run = fetcher.run()
print(run.summary.success)

Metadata

Release files for httporchestrator 1.0.2

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

Source distribution (sdist)

Source distribution for httporchestrator 1.0.2
File Size Uploaded Provenance Actions
httporchestrator-1.0.2.tar.gz 19.3 kB With provenance Details for httporchestrator-1.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 45.1 kB

Release files / httporchestrator-1.0.2.tar.gz

Download URL httporchestrator-1.0.2.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4a7e2107364f922e25e828dc35f8abe3b2c49e1e5b38ed13116bf4c285a2a87f
BLAKE2b-256 checksum
How to use checksums
4c45b34acb0083ae48ff9e70896aea6064843f821ca74379c770c8bfd8e53a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Release files / httporchestrator-1.0.2-py3-none-any.whl

Download URL httporchestrator-1.0.2-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f495544e629334b5aa2c02965a375e9301e9ccc73e78948731725a3fe9cc69c4
BLAKE2b-256 checksum
How to use checksums
601bbd6ebcc49686f46168cd0da2e13843426fb876ba4f08b1d62575ffcd7718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Security for httporchestrator 1.0.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for httporchestrator-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

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

1.0.2 This release

2 release files Full 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