Analyze Mattermost attachments with OpenAI vision for AI agents
Ready for 3.0Ready 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.
- Config (Edit Fields (Set)): sets 5 fields: MATTERMOST_BASE_URL, VISION_MODEL, MAX_IMAGE_SIZE_BYTES…
- Has attachments? (If): checks a condition and branches into true / false
- Split file_ids (Code): runs custom JavaScript code
- Empty result (Edit Fields (Set)): sets 2 fields: attachments_context, attachments_count
- Get file info (HTTP Request): calls an HTTP API
- Classify file (Code): runs custom JavaScript code
- Route by category (Switch): routes items into 3 branches
- Download file (HTTP Request): calls an HTTP API
- Download text file (HTTP Request): calls an HTTP API
- 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
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)
- Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - OpenAI
@n8n/n8n-nodes-langchain.openAi - Merge
n8n-nodes-base.merge - Aggregate
n8n-nodes-base.aggregate
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 ≤…