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

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.23
File Size Uploaded Provenance Actions
workforce-1.1.23.tar.gz 197.9 kB Without provenance Details for workforce-1.1.23.tar.gz

Built distribution (wheel)

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

Total release size: 409.5 kB

Release files / workforce-1.1.23.tar.gz

Download URL workforce-1.1.23.tar.gz
Size 197.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0be620dc7a11180270dc9299326169aed1d09465cf05779ccfdeb3c8140c7628
BLAKE2b-256 checksum
How to use checksums
9f4e2a7fb1c59f2051d27603646834ff542023619a5275c07e60050ee1002039
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.23-py3-none-any.whl

Download URL workforce-1.1.23-py3-none-any.whl
Size 211.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b0b2a539cf4964dd85c0dca87eaa1177a1852d4bf8c04982fcd9f3a72ef2e5e
BLAKE2b-256 checksum
How to use checksums
1c847775cae5b86b134dca948e240b9cba03957ce606a20938c8b0d13988a94a
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.23

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