Templates / Analyze Mattermost attachments with OpenAI vision for AI agents

Analyze Mattermost attachments with OpenAI vision for AI agents

Ready for 3.0

by Sergei Byvshev ✓ · 16 views · created 2026-05-11 · Document Extraction, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 18 nodes and runs when another workflow calls it. Along the way it connects OpenAI.

How it runs

Trigger: When another workflow calls it.

  1. Config (Edit Fields (Set)): sets 5 fields: MATTERMOST_BASE_URL, VISION_MODEL, MAX_IMAGE_SIZE_BYTES…
  2. Has attachments? (If): checks a condition and branches into true / false
  3. Split file_ids (Code): runs custom JavaScript code
  4. Empty result (Edit Fields (Set)): sets 2 fields: attachments_context, attachments_count
  5. Get file info (HTTP Request): calls an HTTP API
  6. Classify file (Code): runs custom JavaScript code
  7. Route by category (Switch): routes items into 3 branches
  8. Download file (HTTP Request): calls an HTTP API
  9. Download text file (HTTP Request): calls an HTTP API
  10. Text too large marker (Edit Fields (Set)): sets 7 fields: file_id, file_name, mime_type…

…plus 7 more steps. See the full node list below.

Services it uses

OpenAI

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (9)

From the author

Overview Subworkflow for analyzing Mattermost attachments. Per-attachment behavior - Image (mime starts with image/, size ≤ MAXIMAGESIZEBYTES): downloaded and analyzed by OpenAI vision model. - Text small (text-like by mime/extension, size ≤…

Excerpt from Sergei Byvshev's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.