Analyze Map with AI Vision

Dinosaur Park Emergency Response - Challenge 2 of 5
Difficulty
2/10
Tags
EssentialsHTTP RequestopenaiAPIAI AgentsJSONimages

You're the control room operator at Isla Dino. You've connected to the park's surveillance feed and can now receive map images showing the current state of all 7 enclosures.

But staring at maps all day is exhausting. What if AI could analyze the images for you and flag any danger zones?

What you'll practice:

  • Using OpenAI's vision capabilities to analyze images
  • Passing image URLs to AI models
  • Writing effective prompts for image analysis
  • Using expressions to reference data from previous nodes

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

Add an AI vision node to analyze the map image and detect danger zones.

Prerequisite: This challenge assumes you have an OpenAI API key configured in n8n. If not, read this guide first.

  1. Start with the workflow from Challenge 1 (already provided)
  2. Add an OpenAI node after the HTTP Request
  3. Configure it for image analysis (Resource: Image, Operation: Analyze)
  4. Set the Image URL to reference the image from the previous node's output
  5. Write a prompt that asks the AI to identify danger zones

Hint: You can drag and drop values from the previous node's output panel into configuration fields.

Expected output: A text response describing which area (if any) is in a state of emergency.

Hints

  1. Add an OpenAI node and connect it after "Control Room Map Screen"
  2. Set Resource to Image and Operation to Analyze
  3. Choose a vision-capable model like gpt-4o or chatgpt-4o-latest
  4. In the Image URLs field, use the expression: {{ $json.incidentReport.imageUrl }}
  5. Write a prompt like: "Identify if any area on this island map is in a state of emergency. An emergency is indicated by a red zone with a 'Danger: Dinosaur Escape!' sign. Report which area number is affected, or confirm all is clear."

Explanation

AI Vision for Image Analysis:

OpenAI's GPT-4 Vision models can analyze images and describe what they see. This is perfect for tasks like:

  • Reading text in images
  • Identifying objects or patterns
  • Detecting anomalies

The Prompt Matters:

A good vision prompt should:

  • Be specific about what to look for
  • Describe the expected format of the answer
  • Give context about what "danger" means in this scenario

Expressions for Dynamic Data:

The expression {{ $json.incidentReport.imageUrl }} pulls the image URL from the previous node's output. Each time the workflow runs, it analyzes whatever image the API returns.

What's Next:

Now that you can detect emergencies, the next step is to brief an AI operator agent who can take action based on your findings.

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise
Step 2 of 5

Next up

Brief the AI Operator

Related Content

Continue your learning journey with these related challenges and guides: