Skip to main content
Glama
orneryd

M.I.M.I.R - Multi-agent Intelligent Memory & Insight Repository

by orneryd
WORKFLOW_MANAGEMENT.mdโ€ข8.18 kB
# Workflow Management in VSCode Extension ## Overview The Mimir VSCode extension provides seamless workflow management with automatic saving, import/export capabilities, and **real-time execution status tracking** via Server-Sent Events (SSE). Workflows are stored as JSON files in a `.mimir/workflows/` directory within your workspace. ## ๐Ÿ“ Directory Structure ``` your-project/ โ”œโ”€โ”€ .mimir/ โ”‚ โ””โ”€โ”€ workflows/ โ”‚ โ”œโ”€โ”€ feature-implementation.json โ”‚ โ”œโ”€โ”€ bug-fix-workflow.json โ”‚ โ””โ”€โ”€ refactoring.json โ”œโ”€โ”€ src/ โ”œโ”€โ”€ package.json โ””โ”€โ”€ .gitignore ``` ## โœจ Features ### 1. **Save Workflow** (๐Ÿ’พ Save button) - Prompts for a workflow name - Automatically saves to `.mimir/workflows/` - Creates the directory if it doesn't exist - Opens the saved file for review - Shows success message with file path **Example:** ``` Workflow file name: feature-auth-implementation.json โœ… Workflow saved to .mimir/workflows/feature-auth-implementation.json ``` ### 2. **Import Workflow** (๐Ÿ“ Import button) - Shows a quick pick menu with all available workflows - Lists workflows sorted alphabetically - Displays count of available workflows - Loads selected workflow onto canvas - Shows success message with task count **Example:** ``` Load Workflow (3 available) โ–ธ bug-fix-workflow.json โ–ธ feature-auth-implementation.json โ–ธ refactoring.json โœ… Loaded workflow: feature-auth-implementation.json (5 tasks) ``` ### 3. **Execute Workflow** (โ–ถ๏ธ Execute button) - Sends workflow to Mimir server for execution - Locks UI during execution - Shows real-time SSE notifications (worker/QC phases) - Tracks deliverables generated during execution - Enables download button when complete ### 4. **Download Deliverables** (๐Ÿ“ฅ Download button) - Appears after workflow execution completes - Shows count of available deliverables - Prompts for save location (defaults to `deliverables/` in workspace) - Downloads all deliverable files from execution - Creates subdirectories as needed - Shows success message with download location **Example:** ``` ๐Ÿ“ฅ Download Deliverables (3) โ”œโ”€โ”€ README_zh.md (12.4 KB) โ”œโ”€โ”€ CHANGELOG.md (5.8 KB) โ””โ”€โ”€ api-docs.html (28.1 KB) โœ… Downloaded 3 deliverables to /workspace/deliverables ``` **Button States:** - **Disabled**: No deliverables available (grayed out, shows count: 0) - **Enabled**: Deliverables available (highlighted, shows count) ### 5. **No Workflows Message** If no workflows exist yet: ``` No workflows found in .mimir/workflows/. Save a workflow first. ``` ## ๐Ÿ”„ Workflow File Format Workflows are stored as JSON with the following structure: ```json { "tasks": [ { "id": "task-1", "title": "Implement authentication", "workerAgent": { "id": "auth-specialist", "name": "Authentication Specialist", "role": "Security & Auth Implementation", "type": "worker", "preamble": "auth-specialist" }, "qcAgent": { "id": "security-qc", "name": "Security QC", "role": "Security Review", "type": "qc", "preamble": "security-qc" }, "parallelGroup": 0, "dependencies": [], "estimatedDuration": "2h", "estimatedToolCalls": 10 } ] } ``` ## ๐ŸŽฏ Best Practices ### Version Control **Option 1: Commit workflows (Recommended for team projects)** ```gitignore # .gitignore # (Keep .mimir/workflows/ tracked) .mimir/logs/ .mimir/cache/ ``` **Option 2: Keep workflows local (Personal development)** ```gitignore # .gitignore .mimir/ ``` ### Workflow Naming Use descriptive names that indicate the workflow's purpose: - โœ… `feature-user-authentication.json` - โœ… `bugfix-memory-leak.json` - โœ… `refactor-api-layer.json` - โŒ `workflow1.json` - โŒ `test.json` ### Workflow Organization For large projects with many workflows, consider subdirectories: ``` .mimir/workflows/ โ”œโ”€โ”€ features/ โ”‚ โ”œโ”€โ”€ auth.json โ”‚ โ””โ”€โ”€ payments.json โ”œโ”€โ”€ bugs/ โ”‚ โ””โ”€โ”€ memory-leak.json โ””โ”€โ”€ maintenance/ โ””โ”€โ”€ dependency-updates.json ``` (Note: Current version saves to flat structure; subdirectory support coming soon) ## ๐Ÿš€ Usage ### Creating a New Workflow 1. Open Studio: `Cmd+Shift+P` โ†’ "Mimir: Open Workflow Studio" 2. Drag agents to canvas to create tasks 3. Configure task details (edit icon โœ๏ธ) 4. Click "๐Ÿ’พ Save" 5. Enter workflow name 6. Workflow saved to `.mimir/workflows/` ### Loading an Existing Workflow 1. Open Studio: `Cmd+Shift+P` โ†’ "Mimir: Open Workflow Studio" 2. Click "๐Ÿ“ Import" 3. Select workflow from list 4. Workflow loads onto canvas ### Editing and Re-saving 1. Load existing workflow 2. Make changes (add/remove tasks, edit agents, etc.) 3. Click "๐Ÿ’พ Save" 4. Choose: - **Same name**: Overwrites existing workflow - **New name**: Creates new workflow file ## ๐Ÿ” Troubleshooting ### "No workspace folder open" - You must have a folder open in VSCode - Use `File โ†’ Open Folder...` to open a project ### "No workflows found" - No `.json` workflow files exist yet in `.mimir/workflows/` - Create your first workflow and save it ### Workflow not loading - Check file format (must be valid JSON) - Ensure file extension is `.json` - Ensure file is in `.mimir/workflows/` directory - Check console for error details ## ๐Ÿ“ Notes - Workflows are workspace-specific - The `.mimir` directory is automatically created - Workflows are human-readable JSON - You can manually edit workflow files if needed - Changes to workflow files are immediately reflected ## ๐Ÿ”ฎ Future Enhancements Coming soon: - [ ] Workflow templates - [ ] Subdirectory support - [ ] Workflow validation - [ ] Import from URL - [ ] Export to shareable format - [ ] Workflow versioning - [ ] Duplicate workflow command - [ ] Rename workflow command - [ ] Delete workflow command ## Real-Time Execution Status (SSE Tracking) When you execute a workflow, the extension connects to the Mimir server's SSE stream to receive real-time updates about task execution progress. Each task displays a colored border and glow effect based on its current status: ### Status Indicators | Status | Border Color | Glow Effect | Animation | Description | |--------|-------------|-------------|-----------|-------------| | **Pending** | Gray | None | None | Task waiting to execute | | **Executing** | ๐ŸŸก Valhalla Gold (#FFD700) | Gold glow (25px) | Pulsing | Task currently running | | **Completed** | ๐ŸŸข Vibrant Green (#22c55e) | Green glow (20px) | None | Task finished successfully | | **Failed** | ๐Ÿ”ด Red (#ef4444) | Red glow (20px) | None | Task encountered an error | ### How It Works 1. **Execute Workflow**: Click "โ–ถ๏ธ Execute Workflow" button 2. **SSE Connection**: Extension connects to `/api/execution-stream/:executionId` 3. **Real-Time Updates**: Server broadcasts task status changes as they happen 4. **Visual Feedback**: Task borders and glows update instantly 5. **Completion**: All tasks show final status (completed/failed) ### SSE Events The extension listens for the following Server-Sent Events: - **`init`**: Initial state when connecting (includes all current task statuses) - **`task-start`**: Task execution begins โ†’ Border turns gold and pulses - **`task-complete`**: Task finishes โ†’ Border turns green or red based on success/failure - **`execution-complete`**: Entire workflow finishes โ†’ UI re-enables - **`error`**: Critical error occurred โ†’ Shows error message ### Example Flow ``` 1. Click Execute โ†’ UI locks, SSE connection established 2. Task 1 starts โ†’ Gold pulsing border appears 3. Task 1 completes โ†’ Green border appears 4. Task 2 starts โ†’ Gold pulsing border appears 5. Task 2 fails โ†’ Red border appears 6. Workflow complete โ†’ UI unlocks ``` ### Benefits - **No Polling**: Efficient server-push model, no repeated HTTP requests - **Instant Feedback**: See task progress in real-time as agents work - **Visual Clarity**: Color-coded status makes it easy to track execution at a glance - **Long-Running Workflows**: Track multi-hour workflows without timeouts

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/orneryd/Mimir'

If you have feedback or need assistance with the MCP directory API, please join our Discord server