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.21

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.21
File Size Uploaded Provenance Actions
workforce-1.1.21.tar.gz 203.7 kB Without provenance Details for workforce-1.1.21.tar.gz

Built distribution (wheel)

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

Total release size: 421.1 kB

Release files / workforce-1.1.21.tar.gz

Download URL workforce-1.1.21.tar.gz
Size 203.7 kB
Tags Source
SHA-256 checksum
How to use checksums
052f66e7908973f9f236c2013399d23d7f9b3f8de9ad48eedc7ef3420d75bc95
BLAKE2b-256 checksum
How to use checksums
aa07a199c97d6f6b6759456297a129d0bb81b7c338eac2756a3f40500559a91f
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.21-py3-none-any.whl

Download URL workforce-1.1.21-py3-none-any.whl
Size 217.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06c750dc4e8952995d099ff25c07246ab1e020639a615236f330ebef79f37736
BLAKE2b-256 checksum
How to use checksums
de3918646c682028287ff4801600d9e4742f921a5f3e212d22f61aa1f0e0d482
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.21

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.21 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