FormaTeX

\usepackage{n8n}

Automate LaTeX PDF generation with n8n

Connect any trigger — a webhook, a form, a database change, or a schedule — to the official FormatEx n8n community node. No custom HTTP wiring required. Your LaTeX documents become part of your automation workflows.

\section{What is n8n}

Workflow automation for developers

n8n is an open-source workflow automation platform. You build workflows visually by connecting nodes — each node performs one action, such as calling an API, reading a database, or sending an email. Workflows can be self-hosted or run on n8n Cloud.

Visual workflow builder

Connect nodes with a drag-and-drop canvas. No code required for most integrations — just configure each node and wire them together.

400+ integrations

n8n ships with nodes for Slack, Google Sheets, Postgres, S3, Gmail, and hundreds of other services — including the official FormaTeX community node for LaTeX workflows.

Self-hostable

Run n8n on your own infrastructure with Docker Compose. Your workflow data stays on your servers, with no SaaS vendor lock-in.

\section{Workflow setup}

Build the workflow in four steps

1

Create FormatEx API credentials

In n8n, go to Credentials → New → FormatEx API. Set API URL to https://api.formatex.io and provide your API key. Credentials are stored encrypted in the n8n credential store.

2

Add a trigger node

Start your workflow with the trigger that fits your use case. A Webhook trigger fires when an external system posts data. A Schedule trigger generates documents at a fixed interval. An n8n Form trigger turns a web form submission into a PDF instantly.

3

Configure the FormatEx node

Add a FormatEx node and configure it as follows:

  • Operation: Compile (or Smart Compile)
  • Credentials: FormatEx API
  • Engine: pdflatex / xelatex / lualatex / latexmk
  • LaTeX field: Use static text or n8n expressions
  • Download PDF as Binary: Enabled

In the LaTeX Source field, use n8n expressions {{ $json["field"] }} to inject data from the trigger node into your document:

# n8n community package
npm install n8n-nodes-formatex

# In n8n UI
Credentials:
- API URL: https://api.formatex.io
- API Key: your key

Node:
- Type: FormatEx
- Operation: Compile
- Engine: pdflatex
- Download PDF as Binary: true
4

Save or deliver the PDF

The FormatEx node returns binary data when enabled. Connect a Write Binary File node to save the PDF to disk, an AWS S3 node to upload it to a bucket, a Gmail node to send it as an attachment, or a Google Drive node to store it in a shared folder. Combine nodes to do all of the above in one workflow run.

\section{Credential storage}

Keeping your API key secure in n8n

Never paste your API key directly into a node parameter or workflow JSON. n8n's credential store encrypts secrets at rest using AES-256. Credentials are referenced by name and never appear in workflow exports.

Self-hosted n8n: credentials are encrypted with a key derived from N8N_ENCRYPTION_KEY in your environment file.
n8n Cloud: credentials are stored in an encrypted database managed by n8n. You can also enable external secrets via AWS Secrets Manager or HashiCorp Vault.
Never commit your n8n workflow JSON exports to a public repository — they reference credential IDs that could expose which services you integrate with.

\section{Use cases}

Workflows you can build today

Scheduled reports

Trigger a workflow on a cron schedule, pull data from a database or spreadsheet, render a LaTeX template, and email the compiled PDF to a distribution list every Monday morning.

Form to PDF

Connect an n8n Form or a Typeform webhook to the FormaTeX API. The moment a user submits a form, a personalised PDF is generated and returned or emailed within seconds.

Invoice and contract generation

Watch a CRM or payment system for new records. For each new order, render an invoice LaTeX template, compile it to PDF, and attach it to a confirmation email automatically.

Bulk document export

Feed a spreadsheet or database query into an n8n loop. For each row, compile a personalised LaTeX document and upload the PDF to S3 or Google Drive in a single workflow run.

\section{Related integrations}

More automation and SDK guides

Use FormaTeX from any automation platform or programming language.

Start automating LaTeX PDFs with n8n

Free tier — 15 API compilations per month. No credit card required.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy