Skip to main content

Convert PDF, DOC, and images to Markdown using Datalab.to API

Workflow preview

Workflow preview
100%
Convert PDF, DOC, and images to Markdown using Datalab.to API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n workflow converts various file formats (.pdf, .doc, .png, .jpg, .webp) to clean markdown text using the datalab.to API. Perfect for AI agents, LLM processing, and RAG...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.wait, n8n-nodes-base.stickynote, n8n-nodes-base.switch

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Joseph.

Original n8n.io source

1.1 Workflow description

Title
Convert PDF, DOC, and images to Markdown using Datalab.to API
Workflow name
Convert PDF, DOC, and images to Markdown using Datalab.to API

This n8n workflow converts various file formats (.pdf, .doc, .png, .jpg, .webp) to clean markdown text using the datalab.to API. Perfect for AI agents, LLM processing, and RAG (Retrieval Augmented Generation) data preparation for vector databases.

Workflow Description

Input

  • Trigger Node: Form trigger or webhook to accept file uploads
  • Supported Formats: PDF documents, Word documents (.doc/.docx), and images (PNG, JPG, WEBP)

Processing Steps

  1. File Validation: Check file type and size constraints
  2. HTTP Request Node:
    • Method: POST to https://api.datalab.to/v1/marker
    • Headers: X-API-Key with your datalab.to API key
    • Body: Multipart form data with the file
  3. Response Processing: Extract the converted markdown text
  4. Output Formatting: Clean and structure the markdown for downstream use

Output

  • Clean, structured markdown text ready for:
    • LLM prompt injection
    • Vector database ingestion
    • AI agent knowledge base processing
    • Document analysis workflows

Setup Instructions

  1. Get API Access: Sign up at datalab.to to obtain your API key
  2. Configure Credentials:
    • Create a new credential in n8n
    • Add Generic Header: X-API-Key with your API key as the value
  3. Import Workflow: Ready to process files immediately

Use Cases

  • AI Workflows: Convert documents for LLM analysis and processing
  • RAG Systems: Prepare clean text for vector database ingestion
  • Content Management: Batch convert files to searchable markdown format
  • Document Processing: Extract text from mixed file types in automated pipelines

The workflow handles the complexity of different file formats while delivering consistent, AI-ready markdown output for your automation needs.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 2 - Get Markdown

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Send to Datalab API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Set Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 6 - Sticky Note13

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 11 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Convert PDF, DOC, and images to Markdown using Datalab.to API
Complexity intermediate
Nodes 11
Categories Document Extraction, Multimodal AI
Author Joseph
Published 26 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7887/7887.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert PDF, DOC, and images to Markdown using Datalab.to API do?

This n8n workflow converts various file formats (.pdf, .doc, .png, .jpg, .webp) to clean markdown text using the datalab.to API. Perfect for AI agents, LLM processing, and RAG...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, Multimodal AI use case.