srunx is a modern Python library for the SLURM workload manager that integrates workflow orchestration capabilities, providing a unified CLI, Web dashboard, and Python API for SLURM job management. Its goal is to free users from having to switch back and forth between sbatch scripts, squeue loops, and SSH sessions.
Main capabilities
- Job submission and control: Provides commands corresponding to the native SLURM CLI (such as sbatch, squeue, sinfo, sacct, etc.), preserving existing usage habits.
- Status and accounting: View job status, history, and GPU availability, with support for monitoring operations such as tail and watch.
- Workflow orchestration: Define pipelines using YAML; jobs run as soon as their dependencies complete, and independent branches execute automatically in parallel. Supports Jinja2 parameterization, inter-job exports (parent jobs declare exports, child jobs read them via {{ deps.<parent>.<key> }}), per-job container configuration (Pyxis / Apptainer / Singularity), dependency-based scheduling, and per-job retry and retry_delay settings.
- Parameter sweeps: Run the same workflow over a hyperparameter matrix without duplicating YAML, with each cell submitted and tracked independently; sweep axes can also be declared temporarily on the command line.
- Remote cluster support: After configuring an SSH profile once, all commands can be transparently dispatched over SSH via --profile <name>, with syntax and output consistent with local usage. Supports SSH config hosts, saved profiles, ProxyJump, environment variable passthrough (--env KEY=VALUE), and file synchronization via rsync under a per-mount lock, with automatic profile detection from the current directory.
- Web dashboard: Connect to SLURM clusters over SSH, browse, search, filter, and cancel jobs in the browser, visualize job dependencies and run workflows directly, view GPU and node availability for each partition, browse remote files via SSH mounts, and submit shell scripts as sbatch jobs directly from the file tree.
- Slack notifications: After setting SLACK_WEBHOOK_URL (or configuring it in the Web dashboard), append --slack to the flow run command toReceive notification when the job completes; in Python, a SlackCallback can be passed in.
- MCP server: A built-in MCP server that enables Claude Code and other MCP clients to submit jobs, inspect the queue, and drive workflows via stdio. Requires installing the mcp extra and registering the server in the client. Once connected, agents can call run_workflow, optionally passing sweep and mount parameters; transport="<profile>" selects a remote cluster, and mount=<name> converts work_dir / log_dir into remote paths for that mount (mount must be used together with transport).
- Python API: The full CLI capability is available as a Python library, suitable for notebooks, existing Python pipelines, or custom tools, supporting submit-and-wait, submit-then-track, and programmatically running YAML workflows with callbacks.
Usage Requires Python 3.12+ and an accessible SLURM cluster (local or via SSH). The web dashboard and Slack notifications are included in the base installation with no additional components required. AI agent integration (MCP server) requires adding the mcp extra. Installation and usage details can be found in the official documentation (ksterx.github.io/srunx), which includes tutorials, how-to guides, reference, and architecture descriptions.
Use cases Suitable for users who need "SLURM + few dependencies + a good UI," covering everyday SLURM loop operations. If a full-featured scientific workflow tool is needed, Snakemake / Nextflow remain more appropriate choices; srunx is not aimed at Airflow-scale infrastructure.
Limitations Requires Python 3.12+ and an accessible SLURM cluster. MCP integration requires additionally installing the mcp extra. srunx ssh is only used to manage configuration profiles (add / list / sync / test) and does not itself run jobs. Web-triggered sweeps route units against configured SSH profiles through a bounded SlurmSSHExecutorPool, while CLI and MCP runs use the local SLURM client by default.