Skip to main content

workforce

https://img.shields.io/pypi/v/workforce.svg Documentation Status

Workforce creates and runs shell commands in the order of a directed GraphML graph. It supports multiuser editing and running through a Flask + Socket.IO server, a React Flow web frontend, and an equivalent CLI. Like Galaxy, QIIME plugin workflows, AnADAMA2, Snakemake, Nextflow, and Make, it represents work as connected commands; unlike a DAG-only workflow engine, Workforce also supports loops.

Small pipeline example

Quick start

Install Workforce and launch the default Workfile:

pip install workforce
workforce

workforce starts (or connects to) the server at 127.0.0.1:5049, loads the default workfile, and launches the web app. Use workforce start to run the server in the background, workforce start --foreground to run it in the foreground, and workforce stop to request shutdown.

Use workforce edit <workfile> to load a workfile into the server and workforce load <workfile> to add one to the server as a worksession. Set WORKFORCE_URL or WORKFORCE_WORKSESSION to override the default URL or worksession.

Running a graph

Run a worksession from the web frontend by selecting its starting nodes (or no nodes for the default selection) and pressing r. Run the same worksession from the CLI with:

workforce run <worksession>
workforce run <worksession> --nodes node1
workforce run <worksession> --group <groupid>
workforce run <worksession> --wrapper 'docker run image bash -c "{}"'

A selected subset runs as an induced subgraph. Without a subset, selected nodes are start nodes; without a selection, failed nodes are selected; if none have failed, Workforce starts nodes with in-degree zero. Execution and readiness are strictly confined to the active run subgraph.

On success, a node records its PID, exit code, stdout, and stderr, changes to ran, and marks its outgoing edges ready. A target runs after all of its incoming blocking edges are ready. Non-blocking edges do not add another prerequisite and can re-trigger work, including in loops. Workforce supports loops; design loop commands and edges with an intended stopping condition.

Editing

In the web editor, double-click empty canvas to add a node and double-click a node to edit it. Drag from a right handle to a left handle to create a blocking edge. Shift-right-drag creates a non-blocking edge. Press r to run, d to delete selected nodes, w to edit the wrapper, e to edit a node, c to clear, and o to open a .wf workfile named in a selected command.

The CLI exposes the same operations, including workforce node add, workforce edge add, workforce group add, workforce wrapper edit, workforce save, workforce ls, workforce ps, and workforce top.

Complex pipeline editor view

Architecture

The server is authoritative. Every graph mutation goes through ServerContext.enqueue() and the serialized queue in server/queue.py; clients are projections of that state. Node statuses use the state machine "" → run → running → ran, with running → fail and fail → run as the failure and retry transitions. A wrapper is applied deterministically with wrapper.replace("{}", cmd) or, without a placeholder, by concatenation.

Metadata

Release files for workforce 1.1.22

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

Source distribution (sdist)

Source distribution for workforce 1.1.22
File Size Uploaded Provenance Actions
workforce-1.1.22.tar.gz 195.5 kB Without provenance Details for workforce-1.1.22.tar.gz

Built distribution (wheel)

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

Total release size: 404.4 kB

Release files / workforce-1.1.22.tar.gz

Download URL workforce-1.1.22.tar.gz
Size 195.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a40c2da015f8b42fe9eb9d82fc2957da93f13e35a67c57b2ba26713aa3852856
BLAKE2b-256 checksum
How to use checksums
ad290633a05f867e31d549895748f1bf8985224ee723cd59a01319b0910c4dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / workforce-1.1.22-py3-none-any.whl

Download URL workforce-1.1.22-py3-none-any.whl
Size 209.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e646a32c27619776e8f3b3c7479dadda8b3217b55033db4bf4cf3c2c91256bff
BLAKE2b-256 checksum
How to use checksums
7087f473f85494650bddee65492e455737a778fe47986ec8d23aba3cd8ba8e0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for workforce 1.1.22

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

1.1.22 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