Skip to content

Building Workflows

This guide walks you through building workflows in MIFY — from simple chains to complex multi-step pipelines with branching, human approval, and AI orchestration.

MIFY Canvas — visual workflow editor

A workflow in MIFY is a directed acyclic graph (DAG) — a series of connected steps that process data in one direction without loops.

Trigger → Node A → Node B → Node C (output)
↘ Node D ↗

Every workflow has three elements:

  • Trigger — how the workflow starts (manual, webhook, schedule, event, or form submission)
  • Nodes — processing steps (AI calls, data transforms, logic gates, integrations)
  • Edges — connections between nodes that define data flow

MIFY provides 126 native nodes across 24 categories:

CategoryExamplesPurpose
LLMChat, Embed, Image Generate, Vision, ASR, TTSAI model operations
TransformTemplate, JavaScriptData transformation
LogicRoute If, Route Switch, Loop Map, Sub-WorkflowFlow control
RAGIngest, Chunk, Embed, Store, Retrieve, RerankRetrieval-augmented generation
PlatformDify, Flowise, Langflow, n8n, and 20+ moreExternal platform integration
AgentReAct, Multi-Agent (Plan-and-Execute, Reflection, Supervisor, Swarm), CLI Agent, Browser Use, Computer UseAI agent orchestration
SafetyPII Detector, Injection Detector, Jailbreak DetectorContent protection
EnterpriseEmail, Calendar, Notifications, Quota, PolicyBusiness integrations
CloudflareD1, KV, R2, Vectorize, QueuesEdge storage and compute
Sandboxsandbox.exec, sandbox.plan, sandbox.session, host.apply, workspaceIsolated code execution

Let’s build a workflow that answers questions using your own documents.

Drag a Manual Trigger onto the canvas.

Drag a Retrieve node. Configure it:

  • Knowledge Base: Select your knowledge base (create one at /knowledge first)
  • Top K: 5 (return top 5 relevant chunks)

Connect the trigger to the Retrieve node.

Drag a Chat node. Configure it:

  • System Prompt: “Answer the user’s question based on the following context: {{context}}”
  • Provider: Your preferred AI provider
  • Model: Your preferred model

Connect the Retrieve node to the Chat node. The retrieved documents flow as context.

Click Run, enter a question, and see the AI respond using your documents as context.

MIFY includes 149 built-in templates for common patterns:

CategoryTemplatesExamples
RAG9Document Q&A, Knowledge Base Chat
LLM12Text Summary, Translation, Classification
Logic17Conditional Routing, Batch Processing
Platform Demos (Track A + B)60+Flowise Import, Dify Bridge, n8n Connector, Strapi, Directus, Supabase, WordPress, Saleor, MinIO, Mautic, Authentik, Keycloak
Agent5Multi-Agent strategies, Research Agent

Browse templates at /templates in the UI. Click any template to preview it, then Use Template to add it to your canvas.

Add human approval gates to any workflow:

  1. Drag a Pause node between any two nodes
  2. When execution reaches the Pause node, it stops and waits
  3. A notification appears in your Inbox (/inbox)
  4. Review the data, then Approve or Reject
  5. Approved: execution continues. Rejected: execution stops.

Use HITL for:

  • Reviewing AI-generated content before publishing
  • Approving financial transactions
  • Validating data extraction results
  • Any decision that needs human judgment

The Multi-Agent node (mify-agent-multi_agent) coordinates several agents inside a single execution. Pick a strategy when you configure the node:

StrategyWhat it doesWhen to use
Plan-and-ExecuteDecomposes the goal into subtasks, then executes each sequentiallyMulti-step research or planning tasks
ReflectionGenerates an answer, then critiques and revises it in a loopQuality-sensitive output (writing, code review)
SupervisorOne coordinator routes work to specialized worker agentsTasks that need different specialist roles
SwarmPeer-to-peer agent network with a shared message busOpen-ended exploration, parallel research

See the Multi-Agent node reference for configuration.

Every published workflow has a version history at /graphs/[graphId]/versions:

  • Publish — capture the current draft as a GraphVersion snapshot (idempotent)
  • Archive — archive the currently-published version
  • Diff — line-level diff between any two versions (uses diff-match-patch)
  • Draft from version — fork a prior version into a new draft to resurrect/edit it

Each transition is logged for audit. See Execution & Trust.

Trigger any workflow from a multi-page form submission. Three pages back the feature:

  • /forms — list your forms
  • /forms/[formId]/builder — drag-drop builder with conditional fields and multi-page navigation
  • /forms/[formId] — public render of the submittable form

Submissions hit POST /api/forms/:id/submit, which calls the FormTriggerPlugin to start the workflow. See Franchise Operators — Embedded Widgets for the embed flow.

Multiple users can edit a workflow at the same time. The canvas runs on Hocuspocus + Yjs:

  • Each session opens a WebSocket to the Hocuspocus server
  • Auth handshake uses SuperTokens — only authorized users can connect
  • Live presence cursors show who else is in the workflow (with name + color)
  • Edits sync in real time and are periodically saved back to the canonical MifyGraph so versioning continues to work
  • Y.Doc binary state is persisted in Postgres (GraphYjsState table) — connections can reattach without losing work

Powered by the @mify/collab package (W16-8).

Switch a workflow to durable mode (in /graphs/[graphId]/settings) to run it on Temporal:

  • Each node runs as a Temporal Activity — durable, replayable, horizontally scalable
  • Long-running flows survive process restarts without losing progress
  • Full event history captured for every run

Use the time-travel UI at /workflows/[graphId]/runs/[runId] to:

  • Replay from any prior step
  • Fork with overridden inputs to explore alternatives
  • Inspect intermediate state at any point

The /admin/temporal/durable admin page lists all durable runs and surfaces failures for replay.

Publish a workflow, get a stable HTTP endpoint with auto-generated OpenAPI. From /graphs/[graphId]/versions, the WorkflowEndpointInfo panel shows you:

  • The endpoint URL (POST /api/workflow-endpoints/:slug)
  • A sample curl
  • Per-API-key rate-limit policy
  • A link to the auto-generated OpenAPI 3.1 spec for that workflow

The same Published workflow is also exposed as:

  • An MCP tool at /api/workflow-mcp/* — any MCP client (Claude Desktop, Cursor, etc.) can list and call it
  • An A2A v1.0 agent at /api/a2a-server/* — with auto-populated AgentCard.skills
  • A LangGraph Agent Protocol agent at /api/agent-protocol/* — bidirectional bridge
ModeUse CaseBehavior
ExperimentalDevelopmentMinimal overhead, fast iteration
AuditedComplianceFull audit trail, integrity hashing

Already using another workflow platform? Import directly:

PlatformHow
Flowise/canvas → Import → Paste Flowise JSON
Dify/canvas → Import → Paste Dify YAML
Langflow/canvas → Import → Paste Langflow JSON
n8n/canvas → Import → Paste n8n JSON

MIFY maps foreign nodes to native equivalents where possible. Unmapped nodes become “opaque” nodes that delegate to the original platform.

MIFY includes a dedicated content generation system at /content-gen:

PathHow It WorksBest For
MIFY QueueSubmits ComfyUI workflows to GPU providersHigh-quality image/video
AI ProviderDirect calls to AI providers (sync or streaming)Text, quick image gen
ComfyUI LocalRuns workflows on your local ComfyUICustom models, local dev