n8n Integration
Use refile with n8n
n8n is a powerful workflow automation platform that allows you to connect various services and automate tasks without coding. By integrating refile with n8n, you can automatically generate PDFs from markdown content as part of your automated workflows.
Getting Started
- First, sign up for a refile account at refile.co/dashboard to get your API key
- Use the refile playground to test your PDF generation and get the exact API configuration you need
- Click the “Copy cURL” button in the playground to get your API configuration
Creating an n8n Workflow
-
Log in to your n8n instance
-
Click “Add Workflow” to create a new workflow
-
Add an HTTP Request node by clicking the ”+” button
-
Configure the HTTP Request node with the following settings:
The easiest way to set up the HTTP Request node is to:
- Go to the refile playground
- Configure your PDF generation settings
- Click the “Copy cURL” button
- In n8n, click “Import from cURL” in the HTTP Request node
- Paste the cURL command you copied
- n8n will automatically populate all the settings
Alternatively, you can manually configure the node with these settings:
- Method: POST
- URL: https://www.refile.co/api/v1/pdf/markdown
- Headers:
- Authorization: Bearer (your-api-key)
- Content-Type: application/json
- Body: JSON
-
Connect your trigger node (like a Manual Trigger or Schedule Trigger) to the HTTP Request node
-
Add additional nodes to process the PDF URL returned by refile
Example Workflow
Here’s a simple example of how to create a workflow that generates a PDF from markdown:
- Add a Manual Trigger node
- Add a Set node to define your markdown content
- Add the HTTP Request node configured as described above
- Add a Send Email node to email the PDF URL (optional)
Tips
- Use n8n’s expression editor to dynamically generate markdown content
- Store your refile API key in n8n’s credentials manager for security
- Use the “Binary” output type if you need to process the PDF directly in n8n