Intelligent automation app #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We want to create an app where we can create workflows of rhai scripts, ai execution, etc. Perhaps as part of a larger ai app, where people can define agents, roles, workflows that roles can implement etc. The idea is that then bots can be brought alive then can listen to events, or be manually triggered to execute these workflows. These will be control flow graphs, and an example use case is having a role such as QA Engineer defined with this workflow as a functionality of that role, then having a QA Engineer bot instance that listens to commits and then runs a CFG, nodes of which use ai, some are rhai script nodes etc. This uses hero_proc behind the scenes as hero_proc now supports running ai and rhai scripts.
There are already existing archipelagos / islands for creating bots and roles etc. lets make sure we integrate all of these into single archipelago, since all are related. there may even be some functionality for workflows already that we can use.
We should send rhai scripts to hero_proc over hero_proxy and these rhai scripts should contain the instructions for creating bots / roles / these graphs with nodes etc, so then when the rhai script is run by hero_proc the necessary db stuff is created. hero_proc and rhai scripts currently use sqlite for backend but lets also explore how we can get it to use osis like hero_rpc servers use it.
Lets first explore existing code, where things are, come up with questions that need to be answered to understand the issue correctly.
Exploration Report & Questions
What Already Exists
1. Intelligence Archipelago (hero_archipelagos)
The
intelligencearchipelago already consolidates these islands into a tabbed hub:workflow_idreferenceidle/thinking/acting/waiting/error/offline)2. Flow Domain Types (hero_osis_sdk)
The SDK already defines a complete DAG-based workflow system in the
flowdomain:Workflow— Root object withsteps: Vec<WorkflowStep>,entry_step, inputs/outputs, versioningWorkflowStep— Supports 8 step types:prompt— LLM call with system/user prompts, model config, variable interpolation ({{var}})tool_call— External tool invocation (MCP, builtin, or sub-workflow)condition— Branching logic (if/else with operators: equals, contains, regex, gt, lt, etc.)parallel— Execute branches concurrently with merge strategiesloop— for_each, while, or count-based iterationsubworkflow— Call another workflowtransform— Data transformationoutput— Return valuesSteps have
position_x/position_yfields — designed for a visual node editorSteps link via
next_stepandon_error(step IDs)WorkflowExecution— Tracks runtime: status, current step, variables, step snapshotsStepExecution— Per-step tracking: input/output snapshots, timing, retriesAgentCapability.workflow_id— Links agents to workflows (the binding already exists)3. Hero Proc
Job,Run,Action,Serviceconcepts with dependency graphs4. Hero Proxy
What Needs To Be Built
Based on the issue description and existing code, the main gaps are:
Workflowobjects (the types exist but no UI)WorkflowExecutionstatus in real-timetool_callsteps that send Rhai scripts to hero_procQuestions That Need Answers
Architecture:
Workflow execution engine location — The
Workflowtypes live in hero_osis, but the issue says hero_proc runs AI and Rhai. Where should the workflow execution engine live?WorkflowExecutiontracking. hero_proc could be the executor for individual steps (especially Rhai/process steps), while hero_osis orchestrates the DAG.Rhai script generation vs direct execution — Should the workflow editor:
tool_callstep to hero_procHero Proc AI support — The issue says "hero_proc now supports running ai and rhai scripts." From exploration, hero_proc is a process supervisor. How does it execute AI calls? Does it:
Data & Storage:
OSIS vs SQLite for hero_proc — The issue mentions exploring OSIS for hero_proc's storage. Is this:
Workflow state persistence — Should
WorkflowExecutionstate live in:Events & Triggers:
Event system — For bots to "listen to events" (e.g., commits), what event infrastructure exists?
Event sources — What events should bots listen to initially?
UI & Scope:
Visual graph editor approach — For the workflow node editor:
Consolidation scope — The issue says "integrate all into a single archipelago." The Intelligence archipelago already consolidates agents, roles, knowledge, templates, servers, chat, activity. What else needs merging? Are there islands outside the intelligence archipelago that should move in?
MVP scope — For the first iteration, should we focus on:
Proposed Architecture (For Discussion)
Awaiting answers to these questions before proceeding with implementation.
Implementation Progress
Completed
1. Workflows tab added to Intelligence Archipelago
Workflowstab in the intelligence island hub (between Templates and Servers)2. Workflow Service Layer (
workflow_service.rs)FlowClientfrom hero_osis_sdk (flow domain)fetch_workflows,create_workflow,save_workflow,delete_workflowexecute_workflow,get_executionvalidate_workflowfetch_published_workflows3. Visual DAG Workflow Editor (
workflow_graph.rs)4. Workflow Editor (
workflow_editor.rs){{variable}}support), model, output variable5. Workflow List (
workflow_list.rs)6. Rhai Script Generation (
rhai_codegen.rs)generate_rhai_script(workflow)takes a Workflow and produces a Rhai scriptdepends_onrelationships for each WorkflowSteprequiresAIssues Created
Build Status
cargo check -p hero_archipelagos_intelligencepasses clean (only pre-existing warnings from other code).Files Changed/Created
New files:
src/services/workflow_service.rs— OSIS FlowClient CRUDsrc/services/rhai_codegen.rs— Rhai script generation for hero_procsrc/views/workflows/mod.rs— Module rootsrc/views/workflows/workflow_list.rs— Workflow card gridsrc/views/workflows/workflow_editor.rs— Full editor with graph + formssrc/views/workflows/workflow_graph.rs— Visual DAG editorsrc/views/tabs/workflows_tab.rs— Tab wrapperModified files:
Cargo.toml— Addedflowfeature to hero_osis_sdksrc/state.rs— AddedWorkflowstoActiveTabenumsrc/services/mod.rs— Registered new service modulessrc/views/mod.rs— Registered workflows view modulesrc/views/tabs/mod.rs— Registered workflows tabsrc/island.rs— Wired Workflows tab (state, data loading, rendering, metadata)src/lib.rs— Added workflows to get_metadata JSONNext Steps