Convert HTML to PDF via ConvertAPI and Save to Disk

Overview

This workflow automates the conversion of an HTML document into a PDF file using the ConvertAPI service. It is ideal for generating downloadable reports, invoices, or any web-to-PDF transformation on demand. The workflow is triggered manually for testing, but can be adapted to run on a schedule or in response to an event (e.g., a webhook).

It demonstrates how to construct an HTML string, convert it to a binary file using a Code node, send that file to ConvertAPI for PDF conversion, and finally save the resulting PDF to the local disk.

Step-by-Step Nodes

  1. When clicking 'Test workflow' (Manual Trigger) — No auth. Starts the workflow on demand for testing purposes. Does not require any credentials.

  2. Create HTML (Set node) — No auth. Uses the Set node to create a new string field named data containing a complete HTML5 document. The content includes a title, a paragraph, and a section with a footer — a minimal but valid HTML file.

  3. Convert HTML to File (Code node) — No auth. A JavaScript Code node that takes the HTML string from the previous step and converts it into a binary buffer. The buffer is then encoded as a base64 string and attached to the item as binary data (field data) with MIME type application/octet-stream and filename file.html.

  4. Convert File to PDF (HTTP Request) — Authentication: API Key (via a credential of type genericCredentialType or environment variables). Sends a POST request to the ConvertAPI endpoint (URL read from $env.API_BASE_URL) with the binary HTML file as multipart form‑data. The response is expected as a file (binary data). The Accept header is set to application/octet-stream.

  5. Write Result File to Disk (Read/Write File) — No auth. Writes the received PDF binary data to the local file system with the filename document.pdf. The data property name is set to =data, which refers to the binary data from the previous node.

Note: The workflow also includes error‑handling logic (error handler nodes) that are not shown in this simplified export but help manage failures during the HTTP request or file writing steps.

Setup Instructions

  1. Create a ConvertAPI account at https://www.convertapi.com/ and obtain your API secret.
  2. Configure n8n environment variables:
    • API_BASE_URL — the base URL of the ConvertAPI endpoint (e.g., https://v2.convertapi.com/convert/html/to/pdf).
    • If using a credential, create an n8n credential of type genericCredentialType and store your API secret. Otherwise, modify the HTTP Request node to pass the secret via a query parameter or header (e.g., Authorization: Bearer YOUR_SECRET).
  3. Run the workflow by clicking the “Execute Workflow” button or manually triggering it.

Use Cases & Variations

  • Report generation: Replace the static HTML with dynamic data from a database or Google Sheets to generate custom PDF reports.
  • Invoice automation: Combine with a trigger (e.g., a webhook from an e‑commerce platform) to convert order confirmation HTML into a PDF invoice and email it.
  • Batch conversion: Loop through multiple HTML templates or data rows to create multiple PDFs.
  • Cloud storage: Instead of saving to disk, use an S3, Google Drive, or Dropbox node to store the resulting PDF online.
6 nodesmanual triggerData
Read Write FileSticky NoteSetCodeHTTP Request

Workflow JSON

{
  "meta": {
    "instanceId": "workflow-fc78a2e0",
    "versionId": "1.0.0",
    "createdAt": "2025-09-29T07:07:42.561430",
    "updatedAt": "2025-09-29T07:07:42.561445",
    "owner": "n8n-user",
    "license": "MIT",
    "category": "automation",
    "status": "active",
    "priority": "high",
    "environment": "production"
  },
  "nodes": [
    {
      "id": "3409b6e3-aef1-4eb4-acfb-72a73101e109",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        380,
        240
      ],
      "parameters": {},
      "typeVersion": 1,
      "notes": "This manualTrigger node performs automated tasks as part of the workflow."
    },
    {
      "id": "4942cdfc-bc9a-43ac-a60d-06e1ddf52d07",
      "name": "Write Result File to Disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1360,
        240
      ],
      "parameters": {
        "options": {},
        "fileName": "document.pdf",
        "operation": "write",
        "dataPropertyName": "=data"
      },
      "typeVersion": 1,
      "notes": "This readWriteFile node performs automated tasks as part of the workflow."
    },
    {
      "id": "1467a9ab-144d-48cc-a52f-3dca86ca0e8b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        100
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

AI-Powered CV Scanner with Google Sheets & Gemini

Overview This workflow automates the initial screening of job applicants by combining a web form, AI-powered CV analysis, and Google Sheets. When a candidate submits their application (name, email, and CV PDF), the workflow instantly extracts the text from the PDF using Mistral OCR, then sends it to Google Gemini for evaluation against a predefined job description. The AI returns a qualification score (0.0 to 1.0) and a detailed explanation, which are then logged alongside the candidate's details in a Google Sheet. This eliminates manual CV review, speeds up your hiring pipeline, and ensures every applicant is evaluated consistently. Workflow Steps Application Form (Form Trigger) — No auth required. This node presents a custom-branded web form to collect the candidate's Full Name, Email, and CV (PDF upload). The form is styled with a dark, glassmorphism theme and includes animated backgrounds. Once submitted, the workflow triggers automatically. Log Candidate Submission (Google Sheets) — OAuth2. Immediately after form submission, this node appends the candidate's name and email to the 'CVs' Google Sheet. This ensures the application is recorded even if the subsequent analysis steps fail. Extract CV Text (Mistral AI) — API Key auth. This node takes the uploaded PDF file from the form and uses Mistral's OCR API to extract all text content from the CV. It dynamically selects the binary file uploaded in the previous step. AI Qualification (LLM Chain) — This is the core analysis node. It uses a detailed prompt that includes: - A system message defining the AI as a professional, objective hiring assistant. - The full job description for a "Senior Frontend Developer" with core requirements and preferred qualifications. - Clear evaluation logic: candidates missing core requirements cannot score above 0.6; meeting all core requirements yields at least 0.75; preferred qualifications add bonuses up to 1.0. - The extracted CV text as context. - An instruction to output raw JSON only. Gemini 2.5 Flash Lite (Language Model) — API Key auth (Google AI Studio). This node provides the actual AI model (Google Gemini 2.5 Flash Lite) with a temperature of 0.4 for balanced, deterministic outputs. It powers the LLM Chain above. JSON Output Parser (Output Parser) — This node ensures the AI's response is valid JSON with the exact schema: (number) and (string). It prevents malformed responses from breaking downstream nodes. Add CV Analysis (Google Sheets) — OAuth2. After analysis, this node updates the candidate's row in the 'CVs' sheet by matching on the Email column. It writes the and from the AI's output into the corresponding columns. Create 'CVs' Spreadsheet (Google Sheets) — OAuth2. This node runs once when the workflow is first triggered manually. It creates a new Google Sheet named 'CVs' with columns: FullName, Email, QualificationRate, QualificationDescription. Setup Instructions Prerequisites A Google account (for Google Sheets) A Mistral AI account (free tier available) — Get your API key here A Google AI Studio account — Create an API key here Step-by-Step Google Sheets Credentials: In the three Google Sheets nodes, create or select an OAuth2 credential for Google Sheets. Grant access to create and edit spreadsheets. Mistral AI Credential: In the "Extract CV Text" node, create a new credential and paste your Mistral API key. Gemini Credential: In the "Gemini 2.5 Flash Lite" node, create a new credential and paste your Google AI Studio API key. Customize Job Description: Open the "AI Qualification" node and edit the section in the prompt to match your actual job posting. Activate the Workflow: Toggle the workflow to "Active" status. The "Application Form" node will generate a public URL you can share with candidates. Test: Use the "Start Here" manual trigger to initialize the Google Sheet, then submit a test application via the form URL. Use Cases & Variations Custom Job Roles: Replace the Senior Frontend Developer description with any role (e.g., Marketing Manager, Data Scientist, Sales Rep) by editing the prompt in the AI Qualification node. Different Storage: Replace Google Sheets with Airtable, Notion, or a database like PostgreSQL for storing applications and results. Multi-Round Screening: Add a Slack or email notification node to alert the hiring team when a candidate scores above a certain threshold (e.g., >0.8). Interview Scheduling: Connect the output to a Calendly or Google Calendar node to automatically invite high-scoring candidates for an interview. Batch Processing: Modify the trigger to accept a CSV upload of multiple CVs for bulk analysis. Enhanced Analysis: Add more output fields like "years of experience", "top skills", or "red flags" by updating the JSON schema in the Output Parser and the prompt.

18 nodes

Telegram Blockchain DEX Screener AI Agent with Real-Time Token Insights

Overview This workflow creates an intelligent Telegram chatbot powered by OpenAI that provides real-time insights from the DexScreener API. It acts as a personal blockchain DEX research assistant, allowing users to query token profiles, boosted tokens, trading pairs, liquidity pools, and order status directly through Telegram messages. The AI agent automatically determines which DexScreener data sources to query based on the user's natural language request. How It Works The workflow combines two trigger methods (Telegram and n8n Chat) with an OpenAI-powered agent that has access to eight specialized DexScreener API tools. When a user sends a message via Telegram, the workflow extracts the chat ID for session management, passes the message text to the AI agent, which then intelligently selects and calls the appropriate DexScreener tools to gather data, and finally returns the formatted response back to the user in Telegram. Node Breakdown Telegram Trigger (No auth) — Listens for incoming Telegram messages. Configured to capture all message updates. Requires a Telegram bot token set up in n8n credentials. When chat message received (No auth) — An alternative n8n Chat trigger that also captures messages, providing a webhook-based interface for testing or alternative chat frontends. Adds SessionId (No auth) — A Set node that extracts the from the Telegram message and assigns it as a variable. This enables the AI agent to maintain conversation context per user. OpenAI Chat Model (API Key auth) — Uses the model to power the AI agent's natural language understanding and response generation. Requires an OpenAI API key configured in n8n credentials. Window Buffer Memory (No auth) — Provides short-term conversation memory to the AI agent, allowing it to remember context from previous messages within the same session. Blockchain DEX Screener Insights Agent (No auth) — The core AI agent node. It receives the user's message text from the Telegram trigger and uses a detailed system prompt that describes all available DexScreener tools. The agent autonomously decides which tools to call based on the user's query. DexScreener Latest Token Profiles (No auth) — HTTP Request tool that fetches the latest token profiles from . Rate limit: 60 requests/min. DexScreener Latest Boosted Tokens (No auth) — HTTP Request tool that retrieves the latest boosted tokens from . Rate limit: 60 requests/min. DexScreener Top Token Boosts (No auth) — HTTP Request tool that gets tokens with the most active boosts from . Rate limit: 60 requests/min. DexScreener Search Pairs (No auth) — HTTP Request tool that searches for trading pairs via . Accepts a query parameter. Rate limit: 300 requests/min. DexScreener Check Orders Paid for Token (No auth) — HTTP Request tool that checks orders for a specific token using . Rate limit: 60 requests/min. DexScreener Get Pairs by Chain and Pair Address (No auth) — HTTP Request tool that retrieves pairs by chain and pair address from . Rate limit: 300 requests/min. DexScreener Token Pools (No auth) — HTTP Request tool that fetches liquidity pools for a token from . Rate limit: 300 requests/min. DexScreener Pairs by Token Address (No auth) — HTTP Request tool that retrieves pairs by token address from . Supports comma-separated addresses. Rate limit: 300 requests/min. Telegram (No auth) — Sends the AI agent's response back to the user. Uses the chat ID from the original trigger message and outputs the agent's text response. Setup Instructions Telegram Bot: Create a bot via @BotFather on Telegram and obtain your bot token. Add this as a credential in n8n under "Telegram API". OpenAI Account: Sign up at platform.openai.com and generate an API key. Add this as a credential in n8n under "OpenAI". No additional accounts needed: The DexScreener API is public and requires no authentication. Activate the workflow: After configuring credentials, activate the workflow and send a message to your Telegram bot to test. Use Cases & Variations Trading Research: Ask the bot "What are the latest boosted tokens?" or "Show me top token boosts today" Pair Analysis: Query "Find SOL/USDC pairs" or "Get details for pair 0x... on Ethereum" Portfolio Monitoring: Ask "Check orders for token 0x... on chain 1" Liquidity Analysis: Request "Show me pools for token 0x... on BSC" Variation: Replace Telegram with Slack, Discord, or email triggers for different notification channels Variation: Add a database node to store historical queries and responses for analytics Variation: Add filtering logic to only alert on specific price movements or volume thresholds

15 nodes

Nextcloud Folder Move with Subfolder Support

Overview This workflow automates the process of moving a folder (including all its files and subfolders) from one location to another within a Nextcloud instance. It is especially useful when dealing with external storage that has rate limits, as it moves each file individually to avoid exceeding those limits. The workflow supports recursive traversal of subfolders, recreates the destination folder structure, and optionally deletes the source folder after the move. How It Works The workflow can be triggered manually, via a webhook, or from another workflow. It first validates the input (source and destination paths), then creates the destination folder if it doesn't exist. It lists all files and folders in the source, loops through them, and for each subfolder it recursively lists its contents. All discovered files are collected and then moved one by one to the correct location in the destination. Finally, the original source folder can be deleted (optional). Node Breakdown When clicking "Execute Workflow" (Manual Trigger) — No auth. Starts the workflow when the user clicks the execute button in the editor. Requires the user to set the source and destination paths in the Set paths node. Webhook (Webhook Trigger, disabled) — No auth. Listens for incoming POST requests at a unique path. Expects a JSON body with and properties. The workflow validates the request and proceeds. Execute Workflow Trigger (disabled) — No auth. Allows another n8n workflow to start this one, passing and as parameters. Whether the request is valid / Whether the request is valid1 (IF) — No auth. Checks that the incoming JSON has the required and fields. If not, it stops with an error. Stop and Error: request not valid / Stop and Error: request not valid1 (Stop & Error) — No auth. Throws an error message if validation fails. Set paths (Set) — No auth. Hardcoded example values for manual trigger: , . Users should edit these. Set folder-paths for from and to (Set) — No auth. Extracts and from the incoming data (manual, webhook, or workflow trigger) and passes them downstream. Create to folder if necessary (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Creates the destination folder if it doesn't already exist. Uses the path from the field. Get all folders/files in from-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Lists all items (files and folders) in the source folder. Loop over files and folders (SplitInBatches) — No auth. Iterates over the list of items, processing them in batches (default batch size 1). Whether type is file (IF) — No auth. Checks if the current item is a file or a folder. Files go to consolidation; folders go to subfolder handling. Set new path for subfolder (Set) — No auth. Constructs the destination path for a subfolder by combining the base destination path with the subfolder name. Create subfolder in to-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Creates the corresponding subfolder in the destination. Get all folders/files in found subfolder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Lists the contents of the subfolder (recursive step). Consolidate all files and folders found (NoOp) — No auth. Acts as a junction point to collect all discovered files from recursive calls. Whether there is are more files or subfolders found (IF) — No auth. Checks if the loop has finished (no items left). If yes, proceeds to consolidate; otherwise loops back to process more items. Consolidate all found files (Code) — No auth. JavaScript code that gathers all file items from the NoOp node across multiple iterations into a single array. Set new path for file (Code) — No auth. JavaScript code that calculates the new destination path for each file by stripping the source prefix and appending the relative path to the destination. Loop Over all files (SplitInBatches) — No auth. Iterates over the consolidated list of files, moving them one by one. Move file to destination (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Moves a file from its current path to the computed destination path. Delete from-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. (Optional) Deletes the original source folder after all files have been moved. The node has error handling set to continue on error. Setup Instructions Nextcloud Credentials: You need a Nextcloud account with read/write access to both the source and destination folders. In n8n, create a Nextcloud credential (OAuth2 or Basic Auth) and apply it to all Nextcloud nodes in the workflow. Configure Triggers: - For manual execution, edit the Set paths node with your actual source and destination folder paths (e.g., , ). - For webhook, enable the Webhook node and copy the generated URL. Send a POST request with a JSON body like . - For workflow trigger, pass and as parameters when calling this workflow from another. Optional: If you want to delete the source folder after the move, leave the Delete from-folder node connected. If not, you can disable or remove it. Run: Activate the workflow and trigger it using your chosen method. Use Cases & Variations Migrating data between Nextcloud instances (if both are accessible via the same credentials). Archiving old projects by moving entire project folders to an archive directory. Organizing shared folders where users upload files into a drop folder and you want to move them to a structured destination. Handling rate-limited external storage (e.g., Google Drive mounted in Nextcloud) by moving files individually instead of a bulk move. Adaptation: Replace the Nextcloud nodes with other file storage services (e.g., ownCloud, S3, Google Drive) by swapping the node types and adjusting paths accordingly.

32 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.