Skip to content

workflow-manager

Workflow manager for batch command execution with conditional logic

Version: 9.0.1 | Size: 4.2MB | Author: Warith Al Maawali

License: Proprietary | Website: https://www.digi77.com


File Information

Property Value
Binary Name workflow-manager
Version 9.0.1
Build Date REDACTED-BUILD-TIME
Rust Version 1.82.0
File Size 4.2MB
Author Warith Al Maawali
License Proprietary
Category Kodachi Binary
Description Workflow manager for batch command execution with conditional logic
Git Commit unknown
Metadata Generated 2026-06-23T12:05:02Z
Binary Timestamp Unknown
JSON Data View Raw JSON

SHA256 Checksum

39cf5165e8899c1c87c549dca9edb7469eb30935bab2d51104fde3722db87468

Features

# Feature
1 Template-based workflow management
2 Conditional command execution
3 Batch processing with retry logic
4 State tracking and logging
5 Concurrent execution support
6 Pause steps with user confirmation
7 Pattern matching and regex conditions
8 JSON path subset support (dot fields + array indexes)
9 Prerequisites validation before execution
10 System state checking and probes
11 Reusable probe functions for conditions

Security Features

Feature Description
Authentication Not provided by cli-core (see online-auth)
Encryption Not provided by cli-core
Input Validation Argument parsing via clap; per-command validation is the consumer's responsibility
Rate Limiting Not provided by cli-core

System Requirements

Requirement Value
OS Linux (Debian-based)
Privileges root/sudo for system operations
Dependencies OpenSSL, libcurl

Global Options

Flag Description
-h, --help Print help information
-v, --version Print version information
-n, --info Display detailed information
-e, --examples Show usage examples
--json Output in JSON format
-o, --output-format <FORMAT> Force output format (text
--json-pretty Pretty-print JSON output with indentation
--json-human Enhanced JSON output with improved formatting (like jq)
--fields <FIELD_LIST> Select specific fields to include in output (comma-separated)
--limit <NUMBER> Limit number of results returned
--offset <NUMBER> Skip first N results (for pagination)
-d, --work-dir <PATH> Working directory (defaults to auto-detected base directory)
--port <PORT> Set custom port number (1024-65535)
--log-level <LEVEL> Set log level (error
--verbose Enable verbose output
--quiet Suppress non-essential output
--no-color Disable colored output
--config <FILE> Use custom configuration file
--timeout <SECS> Set operation timeout in seconds (optional; no default applied)
--retry <COUNT> Retry attempts (optional; no default applied)

Commands

Commands

create

Create a new workflow template

Usage:

workflow-manager create [OPTIONS]

add

Add a step to a workflow template

Usage:

workflow-manager add [OPTIONS]

pause

Add a pause step to a workflow template

Usage:

workflow-manager pause [OPTIONS]

include

Add an include step to a workflow template (includes another profile)

Usage:

workflow-manager include [OPTIONS]

list

List all workflow templates

Usage:

workflow-manager list [OPTIONS]

show

Show details of a workflow template

Usage:

workflow-manager show [OPTIONS]

run

Run a workflow template

Usage:

workflow-manager run [OPTIONS]

update

Update a step in a workflow template

Usage:

workflow-manager update [OPTIONS]

delete-step

Delete a step from a workflow template

Usage:

workflow-manager delete-step [OPTIONS]

delete

Delete an entire workflow template

Usage:

workflow-manager delete [OPTIONS]

state

Query system state

Usage:

workflow-manager state [OPTIONS]

prereq

Validate workflow prerequisites

Usage:

workflow-manager prereq [OPTIONS]

Operational Scenarios

Scenario-oriented workflows generated from the binary's built-in -e --json examples.

Scenario 1: Template Management

Create, list, view, and delete workflow templates

Step 1: Creates a new empty workflow template named 'my-workflow'

workflow-manager create my-workflow
Expected Output: Template 'my-workflow' created successfully

Step 2: Creates a workflow with a descriptive label

workflow-manager create backup-workflow --description 'Daily backup routine'
Expected Output: Template 'backup-workflow' created successfully

Step 3: Shows all available workflow templates

workflow-manager list
Expected Output: Workflow Templates (2 total)

Step 4: Displays the full structure of a workflow template

workflow-manager show my-workflow
Expected Output: Workflow Template: my-workflow

Step 5: Permanently removes a workflow template

workflow-manager delete my-workflow
Expected Output: Template 'my-workflow' deleted successfully

Scenario 2: Adding Commands to Workflows

Add steps to workflows. Use comma-separated commands for multiple steps in one call, or add individually.

Step 1: Adds a single command as step 1

workflow-manager add my-workflow 'echo Hello World'
Expected Output: Step 1 added to template 'my-workflow'

Note

Single command creates one step

Step 2: Create workflow then add multiple steps in one command using comma separation

workflow-manager create w1 && workflow-manager add w1 "sudo ip-fetch","sudo online-auth check-login","ip addr show"
Expected Output: Template 'w1' created, 3 steps added to template 'w1'

Note

add requires the workflow to already exist, so chain create first. Comma-separated commands create multiple steps automatically.

Step 3: Create a diagnostic workflow with 3 steps at once

workflow-manager create diagnostics && workflow-manager add diagnostics "./health-control net-check","./tor-switch tor-status","./dns-leak test"
Expected Output: Template 'diagnostics' created, 3 steps added

Note

All steps share the same timeout and condition settings

Step 4: Adds a command with a 10-minute timeout

workflow-manager add my-workflow 'tar czf backup.tar.gz /data' --timeout 600
Expected Output: Step added with 600 second timeout

Step 5: Runs only if the previous command succeeded

workflow-manager add my-workflow 'cleanup.sh' --condition if_success
Expected Output: Step added with conditional execution

Step 6: Runs only if previous output contains 'ERROR'

workflow-manager add my-workflow 'notify-admin.sh' --if-contains 'ERROR'
Expected Output: Step added with pattern matching condition

Scenario 3: Workflow Execution

Run workflows and control execution behavior

Step 1: Executes all commands in the workflow sequentially

sudo workflow-manager run my-workflow
Expected Output: ✅ Workflow completed: Success

Note

Conditions are evaluated before each step

Step 2: Shows what would be executed without running commands

sudo workflow-manager run my-workflow --dry-run
Expected Output: Dry run: 5 steps would be executed

Note

Use for testing workflows before execution

Scenario 4: Managing Individual Steps

Update, delete, and inspect individual workflow steps

Step 1: View all steps with their IDs and details

workflow-manager show my-workflow
Expected Output: Step 1: echo Hello Step 2: ./backup.sh Step 3: ./cleanup.sh

Note

Use this to identify step IDs before updating or deleting

Step 2: Remove step #2 from the workflow

workflow-manager delete-step my-workflow 2
Expected Output: Step 2 deleted from 'my-workflow'

Note

Step IDs are renumbered after deletion

Step 3: Change step #1 command and timeout

workflow-manager update my-workflow 1 'echo Updated Command' --timeout 300
Expected Output: Step 1 updated successfully

Note

All step properties can be updated

Scenario 5: Efficient Batch Building

Build complete workflows quickly by chaining multiple 'add' commands with &&

Step 1: Create workflow and add 3 steps in one command chain

workflow-manager create tor-recovery && workflow-manager add tor-recovery './routing-switch recover internet' --timeout 60 && workflow-manager add tor-recovery './health-control net-check' -c if_success && workflow-manager add tor-recovery './tor-switch start' -c if_success --timeout 120
Expected Output: Template created, 3 steps added successfully

Note

Use && to chain commands efficiently

Step 2: Create and populate a diagnostics workflow with 4 conditional steps

workflow-manager create diagnostics && workflow-manager add diagnostics './health-control net-check' --timeout 30 && workflow-manager add diagnostics './tor-switch tor-status' -c if_success && workflow-manager add diagnostics './dns-leak test' -c if_success && workflow-manager add diagnostics './integrity-check check-all' -c if_success
Expected Output: diagnostics created, 4 steps added

Note

Chain create before add so the workflow exists before steps are appended.

Step 3: Build complete backup workflow with pause and cleanup

workflow-manager create backup && workflow-manager add backup 'tar czf backup.tar.gz /data' && workflow-manager pause backup --message 'Check backup size' -c if_success && workflow-manager add backup 'rsync backup.tar.gz remote:/backups' -c if_success && workflow-manager add backup 'rm backup.tar.gz' -c if_success
Expected Output: Backup workflow with 4 steps created

Note

Mix commands and pauses for interactive workflows. create precedes all add/pause calls.

Scenario 6: Conditional Logic

All available condition types with practical examples

Step 1: Always execute (default behavior, runs regardless)

workflow-manager add my-workflow './check-status.sh' -c always
Expected Output: Step added with 'always' condition

Step 2: Execute only if previous step succeeded (exit code 0)

workflow-manager add my-workflow './deploy.sh' -c if_success
Expected Output: Step added with if_success condition

Note

Most common condition for sequential workflows

Step 3: Execute only if previous step failed (exit code ≠ 0)

workflow-manager add my-workflow './rollback.sh' -c if_fail
Expected Output: Step added with if_fail condition

Note

Useful for error recovery and rollback scenarios

Step 4: Execute if previous output contains pattern "success"

workflow-manager add my-workflow './alert-success.sh' --if-contains "success"
Expected Output: Step added with pattern matching condition

Note

Case-sensitive - matches JSON like \"status\":\"success\"

Step 5: Execute if previous output does NOT contain "errors"

workflow-manager add my-workflow './continue.sh' --if-not-contains "errors"
Expected Output: Step added with negative pattern condition

Note

Case-sensitive - checks for absence of \"errors\" in JSON output

Step 6: Execute if previous output exactly equals "ready"

workflow-manager add my-workflow './handle-done.sh' --if-equals "ready"
Expected Output: Step added with exact match condition

Note

Exact match (case-sensitive) - output is trimmed before comparison

Step 7: Execute if previous output matches regex pattern

workflow-manager add my-workflow './process-result.sh' --if-regex '^status: (ok|success)$'
Expected Output: Step added with regex condition

Note

Supports full regex syntax for complex matching

Step 8: Execute if output does NOT match regex (counting: skip if 4+ HARDENED found)

workflow-manager add my-workflow './skip-if-hardened.sh' --if-not-regex 'HARDENED.*HARDENED.*HARDENED.*HARDENED'
Expected Output: Step added with if_not_regex condition

Note

Inverse regex match - useful for counting occurrences. Pattern matches 4+ 'HARDENED' words.

Step 9: Execute if fewer than 5 services are active (counting with regex quantifiers)

workflow-manager add my-workflow './alert-few-services.sh' --if-not-regex '(service.*active.*){5,}'
Expected Output: Step added with if_not_regex condition

Note

Uses regex quantifiers {5,} to count occurrences. Step runs if pattern does NOT match (< 5 services).

Step 10: Execute if JSON field $.status equals 'connected'

workflow-manager add my-workflow './handle-connected.sh' --if-json-path '$.status="connected"'
Expected Output: Step added with JSON path condition

Note

Previous output must be valid JSON

Step 11: Execute if JSON array element matches value

workflow-manager add my-workflow './finland-detected.sh' --if-json-path '$.data.records[0].country_name="Finland"'
Expected Output: Step added with JSON path array condition

Note

Supports array indexing [0], [1], etc. for nested JSON arrays

Step 12: Execute if nested JSON path with array matches

workflow-manager add my-workflow './proxy-active.sh' --if-json-path '$.data.records[0].connection_status.connection_type="Proxy"'
Expected Output: Step added with complex nested JSON path condition

Note

Can navigate through objects and arrays: $.path.to.array[index].field

Step 13: Execute if JSON boolean field is true

workflow-manager add my-workflow './ip-online.sh' --if-json-path '$.ip_connectivity=true'
Expected Output: Step added with JSON boolean condition

Note

Supports true/false without quotes

Step 14: Execute if JSON number field matches

workflow-manager add my-workflow './status-check.sh' --if-json-path '$.status_code=2'
Expected Output: Step added with JSON number condition

Note

Numbers don't need quotes: =2 not ="2"

Scenario 7: Advanced Features

Pause steps and advanced workflow management

Step 1: Adds an interactive pause point in the workflow

workflow-manager pause my-workflow --message 'Review results before continuing'
Expected Output: Pause step added to workflow

Note

User must press Enter to continue workflow execution

Step 2: Conditional pause only if previous step succeeded

workflow-manager pause backup --message 'Verify backup integrity' -c if_success
Expected Output: Conditional pause step added

Note

Combine pauses with conditions for smart workflows

Step 3: Adds an include step that composes another workflow profile into this template

workflow-manager include my-workflow shared-prereqs --description 'Reusable setup steps'
Expected Output: Include step 3 added to template 'my-workflow'

Note

The profile is expanded into its steps when the workflow runs. Requires