Skip to main content
This recipe walks you through building a real-world AI agent workflow with four node types, conditional routing, and a human-in-the-loop review step.

What We’re Building

An AI content assistant that:
  1. Takes user input
  2. Sends it to an LLM
  3. Routes based on intent (question → answer directly, task → use tools)
  4. Gets human review before outputting the final result

Step 1: Define Node Types

On your backend, define these node types:

Step 2: Configure the Gateway

The intent_router node uses the gateway type. After adding it to the canvas, add branches in its configuration:
  • Branch “Question”: Routes when intent is “question” → connect to a direct text_output
  • Branch “Task”: Routes when intent is “task” → connect to a tool processing chain
Each branch creates a new output port on the gateway node.

Step 3: Add Template Variables

The llm_call node’s system_prompt field uses format: "template" with variables: { ports: ['prompt'] }. This means:
  1. Connect user_input.messagellm_call.prompt
  2. In the LLM’s system prompt, type {{ to see prompt as an autocomplete suggestion
  3. Write: Classify this message: {{ prompt }}
The template editor highlights {{ prompt }} and shows hints below the editor.

Step 4: Wire It Together

In FlowDrop’s visual editor:
  1. Drag all four node types onto the canvas
  2. Connect: user_input.messagellm_call.prompt
  3. Connect: llm_call.responseintent_router.input
  4. Connect: llm_call.metadataintent_router.metadata
  5. Add gateway branches and connect each branch output to the appropriate downstream node

Step 5: Add Human-in-the-Loop

For the “Task” branch, you want human review before the final output. This uses FlowDrop’s interrupt system: On your backend, when the workflow reaches the review step, create an interrupt:
FlowDrop’s playground UI renders this as a review prompt with approve/reject/edit buttons.

Step 6: Test in the Playground

  1. Open the workflow playground (toolbar button or mount mountPlayground())
  2. Type a message like “What is the capital of France?”
  3. Watch it route through the “Question” branch
  4. Type “Write me a blog post about AI” and watch it route through “Task” → human review

Complete Workflow JSON

The final workflow JSON looks like this:

Next Steps