This template converts Apify Actors into n8n community nodes. The generation script reads your Actor's input schema and creates the node package structure, which you can then customize and publish. Simply provide an Actor ID, and the script generates a complete n8n community node package using your Actor's input schema—ready to customize and publish.
Apify is a platform for building, deploying, and publishing web automation tools called Actors, while n8n is a fair-code licensed workflow automation platform that connects various services and APIs.
- Node.js v23.11.1 or higher
- A valid Apify Actor ID from the Apify Store
Install dependencies:
npm installRun the generation script:
npm run create-actor-appWhen prompted, enter your Actor ID. Find this in your Actor's console URL, for example, if your Actor page is https://console.apify.com/actors/aYG0l9s7dbB7j3gbS/input, the Actor ID is aYG0l9s7dbB7j3gbS.
The script fetches your Actor's metadata and input schema, generates node files with proper naming, converts Actor input fields into n8n node parameters, and creates all necessary boilerplate code.
Test the generated node:
npm run build
npm run devAfter generation, your node files will be located in:
nodes/Apify<YourActorName>/
For example, if you converted the Website Content Crawler Actor, the folder will be:
nodes/ApifyWebsiteContentCrawler/
The generated code includes five sections labeled with SNIPPET comments. Search for SNIPPET in your IDE to locate them quickly.
Location: nodes/Apify{YourActorName}/Apify{YourActorName}.node.ts
The script generates these constants from your Actor's metadata:
export const ACTOR_ID = 'aYG0l9s7dbB7j3gbS'
export const CLASS_NAME = 'ApifyWebsiteContentCrawler'
export const DISPLAY_NAME = 'Apify Website Content Crawler'
export const DESCRIPTION = ''Tip: Change
DISPLAY_NAMEorDESCRIPTIONto adjust how your node appears in the n8n interface.
Location: nodes/Apify{YourActorName}/Apify{YourActorName}.node.ts
The default configuration uses the Apify logo:
icon: {
light: 'file:apify.svg',
dark: 'file:apifyDark.svg'
}Replace the SVG files in the node directory with your own branding.
Location: nodes/Apify{YourActorName}/Apify{YourActorName}.node.ts
The subtitle appears beneath your node in n8n workflows:
subtitle: 'Run Scraper',Location: nodes/Apify{YourActorName}/Apify{YourActorName}.node.ts
This description appears in n8n's node browser:
description: DESCRIPTION,Location: nodes/Apify{YourActorName}/helpers/genericFunctions.ts
When your node runs in AI agent workflows, reduce token usage by filtering the returned data:
if (isUsedAsAiTool(this.getNode().type)) {
results = results.map((item: any) => ({ markdown: item.markdown }));
}AI agents perform better with clean, focused data that takes up less context.
The Apify{YourActorName}.node.json file controls where your node appears in n8n:
{
"categories": ["Data & Storage", "Marketing & Content"],
"alias": ["crawler", "scraper", "website", "content"]
}Adjust categories to match your Actor's purpose and add relevant search keywords to alias.
The template includes pre-configured authentication in the credentials/ directory. Users running n8n locally provide their Apify API token. Users on n8n cloud can authenticate via OAuth2.
File: helpers/genericFunctions.ts
This file provides helper functions for authenticated Apify API requests. The apiRequest() function makes authenticated HTTP requests to the Apify API. The isUsedAsAiTool() function detects if the node runs in an AI agent workflow. The pollRunStatus() function polls an Actor run until completion. The getResults() function fetches dataset items with optional AI tool filtering.
The template adds these headers automatically:
'x-apify-integration-platform': 'n8n'
'x-apify-integration-app-id': 'website-content-crawler-app'
'x-apify-integration-ai-tool': 'true' // when used with AIAdd custom request headers, implement retry logic, or filter results for AI tools in this file.
File: Apify{YourActorName}.node.json
This file tells n8n where to categorize your node and what keywords to search for:
{
"categories": ["Data & Storage", "Marketing & Content"],
"alias": ["apify", "crawler", "scraper", "website", "content"],
"resources": {
"credentialDocumentation": [
{ "url": "https://docs.apify.com/platform/integrations/api#api-token" }
],
"primaryDocumentation": [
{ "url": "https://apify.com/apify/website-content-crawler" }
]
}
}Adjust categories, add search keywords to alias, and update documentation links.
This repository contains two README files. This file (README.md) provides instructions for developers using this template to generate n8n nodes from Apify Actors. The README_TEMPLATE.md file provides template documentation for the generated node package that you publish to npm.
After running the generation script, uses README_TEMPLATE.md as the README for your generated node package.
Start n8n with your custom node:
npm run devThis launches n8n at http://localhost:5678 with hot reloading enabled. Changes to your node files automatically refresh.
- Apify API documentation
- n8n Community Nodes documentation
- n8n community
- Template issues - Open an issue in the GitHub repository

