Skip to content

feat(slm): add remote shell execution API + distributed_shell workflow step type for fleet parallelism #3406

@mrveiss

Description

@mrveiss

Context7 Score: 78/100

Test query: "Define a visual workflow that executes three shell scripts in parallel across a distributed fleet."

Audit Findings

What EXISTS

  • autobot-backend/orchestration/dag_executor.py — full DAG executor with asyncio.gather() for independent branches; NodeType.PARALLEL enum value exists but has no handler
  • autobot-backend/orchestration/workflow_executor.py_group_steps_by_dependency() for concurrent step groups
  • autobot-backend/tools/parallel/executor.pyParallelToolExecutor framework
  • autobot-slm-backend/api/nodes.py — node enrollment, health, lifecycle management
  • autobot-backend/api/sandbox.py — local secure shell execution (Docker sandbox)

What is MISSING

  1. No remote execution APIPOST /nodes/{node_id}/execute does not exist on SLM backend
  2. No distributed_shell step type — workflow executor has no handler to fan-out a script to multiple fleet nodes in parallel
  3. Visual builder has no parallel/fleet step configuration UI (tracked separately)
  4. No docs/example for fleet parallel workflows

Acceptance Criteria

SLM Backend

  • POST /nodes/{node_id}/execute endpoint in autobot-slm-backend/api/ accepting {command, script, language, timeout, stream_output}
  • SLM agent (slm/agent/agent.py) receives and executes remote commands; streams stdout/stderr back
  • Command validation: audit log entry per execution, timeout enforcement, allowlist check

AutoBot Backend

  • distributed_shell step type handler in dag_executor.py — reads {script, nodes: [node_id, ...], timeout} from step config, fans out to N nodes via parallel SLM execute calls, returns per-node {node_id, exit_code, stdout, stderr}
  • NodeType.PARALLEL handler updated (or distributed_shell as new NodeType) to use the above

Docs & Example

  • docs/examples/parallel_fleet_workflow.py — creates a workflow with 3 parallel shell steps targeting 3 nodes
  • docs/user/guides/workflows.md — "Parallel Fleet Execution" section with step config reference

Tests

  • Unit: dag_executor fans out to N nodes, aggregates results correctly
  • Unit: SLM execute endpoint validates command, returns structured output
  • Integration: end-to-end workflow with 2+ parallel shell steps

Files to Touch

  • autobot-slm-backend/api/nodes_execution.py (new)
  • autobot-slm-backend/slm/agent/agent.py
  • autobot-backend/orchestration/dag_executor.py
  • autobot-backend/orchestration/workflow_executor.py
  • docs/examples/parallel_fleet_workflow.py (new)
  • docs/user/guides/workflows.md

Out of Scope (separate issue)

  • Frontend visual builder UI for parallel/fleet steps

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions