Create Emergency Logging Tool

Dinosaur Park Emergency Response - Challenge 4 of 5
Difficulty
3/10
Tags
EssentialsExecute Workflow TriggerTool WorkflowopenaiAI Toolssub-workflowsJSON

You're the control room operator at Isla Dino. Your AI Operator can receive briefings about the park status, but right now it can only talk - it can't actually do anything.

In n8n, you can give AI agents "tools" - sub-workflows they can call to perform actions. In this challenge, you'll create a logging tool that the AI Operator can use to record emergency events.

What you'll practice:

  • Creating sub-workflows with input parameters
  • Using the "Execute Workflow Trigger" for sub-workflows
  • Connecting sub-workflows as AI tools
  • Using n8n's AI parameter filling feature

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

Create a sub-workflow that logs emergencies, then connect it as a tool for the AI Operator.

Important: Sub-workflows should live in their own n8n workflow file, not on the same canvas as your main workflow. This keeps things organized and avoids errors when connecting tools.

Part A: Create a new workflow with a "When Executed by Another Workflow" trigger that accepts emergency data (status, time, location, dinosaur count).

Part B: Connect this workflow as a tool to the AI Operator so it can call it automatically.

Expected output: When the AI Operator receives a briefing, it calls the logging tool with the appropriate parameters.

Hints

Part A - Sub-Workflow (in a NEW workflow):

  1. Create a new workflow in n8n (keep it separate from your main workflow for cleaner organization)
  2. Add a "When Executed by Another Workflow" trigger node
  3. Click "Add Field" to define inputs:
    • Name: emergency_status, Type: Boolean
    • Name: time_of_emergency, Type: String
    • Name: location_of_emergency, Type: String
    • Name: amount_of_escaped_dinosaurs, Type: String
  4. Save AND Publish the workflow - both are required! Click Save (Ctrl/Cmd + S), then click the Publish button.

Part B - Connect the Tool (back in your main workflow):

  1. Go back to your main workflow
  2. Search for "Call n8n Workflow Tool" and add it
  3. Drag a connection from the small circle BELOW the AI Operator to this tool
  4. Select your sub-workflow from the dropdown
  5. Set Description: "Call this tool to log the time, area, and severity of any emergencies. If there is no emergency, log the emergency_status as false, enter the time and for the rest NULL."
  6. The input fields will auto-populate after selecting the workflow
  7. Click the sparkles icon (✨) next to each parameter to let the AI fill in values automatically

Explanation

What are AI Tools?

AI tools let language models take actions in the real world. Instead of just generating text, the AI can:

  • Call APIs
  • Write to databases
  • Trigger other workflows
  • Send notifications

The Tool Connection:

In n8n, tools connect to the small circle below AI nodes (not the main output). This special connection means "the AI can call this when needed."

AI Parameter Filling:

When configuring tool inputs, click the sparkles icon (✨) next to each parameter. This tells n8n to let the AI decide what value to pass based on the field name and description.

Sub-Workflows as Tools:

By using "When Executed by Another Workflow", you create reusable components. The main workflow doesn't need to know the implementation details - it just calls the tool with parameters.

What's Next:

Your AI Operator can now log emergencies. In the final challenge, you'll add logic to dispatch the emergency response squad when a real emergency is detected.

Solution Setup Instructions:

This solution has two separate workflows that must be set up in order:

Step 1: Create the Sub-Workflow first

  1. Click "Copy Sub-Workflow" below
  2. Create a new workflow in n8n and paste it
  3. Save AND Publish the workflow (both required!)

Step 2: Set up the Main Workflow

  1. Click "Copy Main Workflow" below
  2. Paste into your exercise workflow
  3. The Tool node will show an error - this is expected
  4. Click the Tool node and select your published sub-workflow
  5. Now the connection is established

Why separate? n8n Tool nodes store a workflow ID reference. When you copy a workflow with a Tool node, that ID doesn't exist in your n8n instance yet.

Copy the Solution

This solution has multiple workflows. Copy them in order and paste into n8n.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise
Step 4 of 5

Next up

Dispatch the Emergency Squad

Related Content

Continue your learning journey with these related challenges and guides: