AutomationFlowsWeb Scraping › Transform Uploaded Documents Into Structured Data with Unstructured Mcp

Transform Uploaded Documents Into Structured Data with Unstructured Mcp

ByUnstructured @unstructured on n8n.io

This workflow collects an uploaded document via an n8n form and uses Unstructured’s hosted Transform MCP server to convert it into structured, LLM-ready text output, then returns the extracted content and basic stats (elements, characters) while handling size limits and…

Event trigger★★★★☆ complexityAI-powered24 nodesForm TriggerMcp ClientHTTP RequestStop And ErrorForm
Web Scraping Trigger: Event Nodes: 24 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #16986 — we link there as the canonical source.

This workflow follows the Form → Form Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "7RZtb0W0VRjkQlAh",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Transform MCP Template",
  "tags": [],
  "nodes": [
    {
      "id": "9ff1df09-3fa1-4dde-b460-3ef459e71015",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -176
      ],
      "parameters": {
        "width": 480,
        "height": 896,
        "content": "## Transform MCP Template\n\n### How it works\n\nThis workflow accepts a file through a form, validates that it is under a 50 MB limit, uploads it through an MCP-provided upload URL, and starts a transformation job. It polls the MCP service until the job completes, then retrieves result metadata, downloads extracted content when available, and formats the final response. If the file is too large, no content is found, or the transform job fails, the workflow routes to the appropriate user-facing or error outcome.\n\n### Setup steps\n\n- Configure the form trigger fields so users can upload the expected file type and ensure the file binary property matches the workflow expressions.\n- Set up credentials and endpoint configuration for the MCP Client nodes used to request upload URLs, start transforms, check status, and fetch results.\n- Confirm the HTTP Request nodes can access the generated upload and download URLs and that binary upload/download settings match the MCP service requirements.\n- Review the 50 MB validation condition and any MCP tool parameters, such as transform options or output format.\n\n### Customization\n\nYou can adjust the file size cap, polling interval, transform parameters, and final formatted fields such as status, source_file, elements, and characters."
      },
      "typeVersion": 1
    },
    {
      "id": "48d4c5c2-7f93-46af-8427-d63b1fb38863",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        272
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 320,
        "content": "## Receive and validate file\n\nStarts the workflow from a submitted form and checks whether the uploaded file is within the allowed 50 MB limit before continuing."
      },
      "typeVersion": 1
    },
    {
      "id": "0f242155-f482-4d79-b389-a498e6b091cf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        400
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 336,
        "content": "## Handle oversized files\n\nShows the alternate response when the submitted file exceeds the configured size cap."
      },
      "typeVersion": 1
    },
    {
      "id": "459fec72-48aa-4060-a69f-41cfefedd5d9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 320,
        "content": "## Upload source file\n\nRequests a file upload URL from the MCP service, attaches the submitted binary file to that upload request, and sends it with an HTTP PUT request."
      },
      "typeVersion": 1
    },
    {
      "id": "f7ff32d4-5b8b-4573-a3a5-b03b8b22b7a9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 320,
        "content": "## Start transform job\n\nStarts the file transformation through MCP and performs the first status check for the created job."
      },
      "typeVersion": 1
    },
    {
      "id": "244cc8db-deef-4521-9660-f3ad22b19fbc",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 640,
        "content": "## Route job status\n\nBranches based on the transform job status, looping through a five-second wait while the job is still running and stopping with an error when the job fails."
      },
      "typeVersion": 1
    },
    {
      "id": "62085071-e367-45f7-998e-2b2aeaf1553e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1968,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 320,
        "content": "## Fetch result metadata\n\nRetrieves the completed transform results from MCP and checks whether the response contains a downloadable output file URL."
      },
      "typeVersion": 1
    },
    {
      "id": "5760dc5b-104a-4ce3-9483-94509ef0967d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2416,
        -176
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 528,
        "content": "## Download and format results\n\nDownloads transformed content when a URL is available, handles the no-content path, and formats the final output fields returned by the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "fe9d2df0-98ee-4d92-8688-494f75e236c2",
      "name": "When Form Submitted",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        432
      ],
      "parameters": {
        "options": {},
        "formTitle": "Document",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "document",
              "requiredField": true,
              "acceptFileTypes": ".pdf,.docx,.doc,.odt,.rtf,.txt,.md,.html,.xml,.epub,.pptx,.ppt,.xlsx,.csv,.tsv,.eml,.msg,.png,.jpg,.jpeg,.heic,.tiff,.bmp"
            }
          ]
        },
        "formDescription": "Please upload a file below"
      },
      "typeVersion": 2.6
    },
    {
      "id": "1970b012-af1a-4a34-8faf-89cceb21b9e6",
      "name": "If File Size \u2264 50MB",
      "type": "n8n-nodes-base.if",
      "position": [
        224,
        432
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "sizecap",
              "operator": {
                "type": "number",
                "operation": "smallerEqual"
              },
              "leftValue": "={{ $json.document[0].size }}",
              "rightValue": 52428800
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "519fda9e-d5a9-4d28-9737-743d2a67ec7c",
      "name": "Fetch Upload URL",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "position": [
        448,
        208
      ],
      "parameters": {
        "tool": {
          "__rl": true,
          "mode": "list",
          "value": "request_file_upload_url",
          "cachedResultName": "request_file_upload_url"
        },
        "options": {},
        "parameters": {
          "value": {
            "filename": "={{ $('When Form Submitted').item.binary.document.fileName }}",
            "size_bytes": "={{ $('When Form Submitted').item.binary.document.data.length() }}",
            "content_type": "={{ $('When Form Submitted').item.binary.document.mimeType }}"
          },
          "schema": [
            {
              "id": "filename",
              "type": "string",
              "display": true,
              "removed": false,
              "required": true,
              "displayName": "filename",
              "defaultMatch": false
            },
            {
              "id": "content_type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": true,
              "displayName": "content_type",
              "defaultMatch": false
            },
            {
              "id": "size_bytes",
              "type": "number",
              "display": true,
              "removed": false,
              "required": true,
              "displayName": "size_bytes",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "endpointUrl": "https://mcp.transform.unstructured.io/",
        "authentication": "bearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "d1799a9b-d566-4623-8605-a364ca9020e7",
      "name": "Append File to Upload Request",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        208
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const item = $input.item;\nitem.binary = $('When Form Submitted').item.binary;\nreturn item;"
      },
      "typeVersion": 2
    },
    {
      "id": "fe3014a2-2fc7-4d05-825a-6a2e83ed022a",
      "name": "Upload File to URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        208
      ],
      "parameters": {
        "url": "={{ $json.structuredContent.upload_url }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "={{ $json.structuredContent.headers['Content-Type']}}"
            }
          ]
        },
        "inputDataFieldName": "document"
      },
      "typeVersion": 4.4
    },
    {
      "id": "ad3d12a4-f8c6-464e-825e-8b26cb9893e1",
      "name": "Initiate File Transformation",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "disabled": true,
      "position": [
        1120,
        336
      ],
      "parameters": {
        "tool": {
          "__rl": true,
          "mode": "list",
          "value": "transform_files",
          "cachedResultName": "transform_files"
        },
        "options": {},
        "inputMode": "json",
        "jsonInput": "={\n  \"file_refs\": [\"{{ $('Fetch Upload URL').item.json.structuredContent.file_ref }}\"]\n}",
        "endpointUrl": "https://mcp.transform.unstructured.io/",
        "authentication": "bearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c9ea365d-325e-4514-b243-ee1099c59335",
      "name": "Check Transformation Status",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "position": [
        1344,
        336
      ],
      "parameters": {
        "tool": {
          "__rl": true,
          "mode": "list",
          "value": "check_transform_status",
          "cachedResultName": "check_transform_status"
        },
        "options": {},
        "inputMode": "json",
        "jsonInput": "={\n     \"job_id\": \"{{ $('Initiate File Transformation').item.json.structuredContent.job_id }}\"\n   }",
        "endpointUrl": "https://mcp.transform.unstructured.io/",
        "authentication": "bearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "88a4108d-49a7-4409-8a8f-c0b5ea5871c1",
      "name": "Route by Job Status",
      "type": "n8n-nodes-base.switch",
      "position": [
        1568,
        176
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "COMPLETED",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c065e402-9c99-4732-b097-7a099beff616",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.structuredContent.status }}",
                    "rightValue": "COMPLETED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "SCHEDULED",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d83c5a0a-d70a-4a91-a8a5-6f3900d95a9d",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.structuredContent.status }}",
                    "rightValue": "SCHEDULED"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "IN_PROGRESS",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "deecb7f2-da89-4184-8297-919e45c776c9",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.structuredContent.status }}",
                    "rightValue": "IN_PROGRESS"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "ignoreCase": false,
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Other"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "45f834c2-851b-423c-9f42-707c854fa54e",
      "name": "Fetch Transformation Results",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "position": [
        2016,
        96
      ],
      "parameters": {
        "tool": {
          "__rl": true,
          "mode": "list",
          "value": "get_transform_results",
          "cachedResultName": "get_transform_results"
        },
        "options": {},
        "inputMode": "json",
        "jsonInput": "={\n  \"job_id\": \"{{ $('Initiate File Transformation').item.json.structuredContent.job_id }}\"\n}",
        "endpointUrl": "https://mcp.transform.unstructured.io/",
        "authentication": "bearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "903845ec-cbc1-4ab9-b74c-2090be5cf96b",
      "name": "If Download URL Available",
      "type": "n8n-nodes-base.if",
      "position": [
        2240,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "hasurl",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.structuredContent.files && $json.structuredContent.files[0] && $json.structuredContent.files[0].download_url ? true : false }}",
              "rightValue": true
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.3
    },
    {
      "id": "df2c600a-82be-40a0-b571-a39214f8d9ad",
      "name": "Download Transformation Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2464,
        0
      ],
      "parameters": {
        "url": "={{ $json.structuredContent.files[0].download_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "d1b02e43-ea94-4484-83b4-c02361bf6b22",
      "name": "Set Final Output Format",
      "type": "n8n-nodes-base.set",
      "position": [
        2688,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "333de7af-453c-4229-b2ca-63fce8380e08",
              "name": "status",
              "type": "string",
              "value": "Success"
            },
            {
              "id": "96823779-9c6b-424b-81aa-86d65013d61f",
              "name": "source_file",
              "type": "string",
              "value": "={{ $('When Form Submitted').item.binary.document.fileName }}"
            },
            {
              "id": "9cb85ce4-56d1-4cbe-ab79-cbf276c1ab9c",
              "name": "elements",
              "type": "number",
              "value": "={{ $('Fetch Transformation Results').item.json.structuredContent.files[0].element_count }}"
            },
            {
              "id": "0528b2c7-6bf7-424b-81aa-86d65013d61f",
              "name": "characters",
              "type": "number",
              "value": "={{ $('Fetch Transformation Results').item.json.structuredContent.files[0].character_count }}"
            },
            {
              "id": "94fdd0b0-1918-4d39-85c4-48ddbf76f647",
              "name": "output_format ",
              "type": "string",
              "value": "={{ $('Fetch Transformation Results').item.json.structuredContent.output_format }}"
            },
            {
              "id": "ead1e944-ee1c-4d98-8824-e1ae5ca4ffb1",
              "name": "content",
              "type": "string",
              "value": "={{ $json.data }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "afcae948-30fe-4746-bfa0-0c58a5aff12b",
      "name": "Set No Content Status",
      "type": "n8n-nodes-base.set",
      "position": [
        2464,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1b2c3d4-+123456789001",
              "name": "status",
              "type": "string",
              "value": "No content could be extracted from this document."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "629fcad2-b870-4808-afb0-1a00ae218d62",
      "name": "Wait for 5 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        1792,
        288
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c8f54ee8-1d3e-4f15-aa56-44ac25ee3d7a",
      "name": "Halt with Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1792,
        480
      ],
      "parameters": {
        "errorMessage": "=Transform job ended with status {{ $json.structuredContent.status }}. job_id: {{ $('Initiate File Transformation').item.json.structuredContent.job_id }}"
      },
      "typeVersion": 1
    },
    {
      "id": "9d8673ab-ae8a-46f0-8cf3-6479ebfb4b63",
      "name": "Notify File Too Large",
      "type": "n8n-nodes-base.form",
      "position": [
        576,
        576
      ],
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "File too large",
        "completionMessage": "=Your file is {{ ($json.document[0].size / 1048576).toFixed(1) }} MB, which exceeds the 50 MB limit. Please upload a smaller document and try again."
      },
      "typeVersion": 2.5
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "49537a68-025e-4965-98be-aeea592adbb7",
  "nodeGroups": [],
  "connections": {
    "Fetch Upload URL": {
      "main": [
        [
          {
            "node": "Append File to Upload Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload File to URL": {
      "main": [
        [
          {
            "node": "Initiate File Transformation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for 5 Seconds": {
      "main": [
        [
          {
            "node": "Check Transformation Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Job Status": {
      "main": [
        [
          {
            "node": "Fetch Transformation Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for 5 Seconds",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for 5 Seconds",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Halt with Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Form Submitted": {
      "main": [
        [
          {
            "node": "If File Size \u2264 50MB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If File Size \u2264 50MB": {
      "main": [
        [
          {
            "node": "Fetch Upload URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify File Too Large",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set No Content Status": {
      "main": [
        [
          {
            "node": "Set Final Output Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Download URL Available": {
      "main": [
        [
          {
            "node": "Download Transformation Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set No Content Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Transformation Status": {
      "main": [
        [
          {
            "node": "Route by Job Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Transformation Results": {
      "main": [
        [
          {
            "node": "If Download URL Available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate File Transformation": {
      "main": [
        [
          {
            "node": "Check Transformation Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append File to Upload Request": {
      "main": [
        [
          {
            "node": "Upload File to URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Transformation Results": {
      "main": [
        [
          {
            "node": "Set Final Output Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow collects an uploaded document via an n8n form and uses Unstructured’s hosted Transform MCP server to convert it into structured, LLM-ready text output, then returns the extracted content and basic stats (elements, characters) while handling size limits and…

Source: https://n8n.io/workflows/16986/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

Answer legal questions with grounded citations from CanLII and CourtListener. Uses formTrigger, httpRequest, lmChatGroq, outputParserStructured. Event-driven trigger; 22 nodes.

Form Trigger, HTTP Request, Groq Chat +3
Web Scraping

This workflow allows you to import any workflow from a file or another n8n instance and map the credentials easily. A multi-form setup guides you through the entire process At the beginning you have t

Execute Command, Read Write File, HTTP Request +3
Web Scraping

[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.

HTTP Request, GitHub, Stop And Error +1
Web Scraping

[](https://youtu.be/c7yCZhmMjtI)

HTTP Request, GitHub, Stop And Error +1
Web Scraping

LDX hub All Services Demo. Uses formTrigger, httpRequest, form, n8n-nodes-ldxhub. Event-driven trigger; 53 nodes.

Form Trigger, HTTP Request, Form +1