This is an n8n community node that integrates Apify with your n8n workflows, so you can run Apify Actors, extract structured data from websites, and automate complex web scraping tasks.
Apify is a platform for developers to build, deploy, and publish web automation tools, while n8n is a fair-code licensed tool for AI workflow automation that allows you to connect various services.
- Installation
- Operations
- Credentials
- Compatibility
- Usage
- Resources
- Release
- Version History
- Troubleshooting
- Node.js (recommended: v18.10+)
- pnpm installed globally
Begin by installing and running n8n to create the necessary configuration directory (~/.n8n
):
npm install -g n8n # Skip this step if you already have n8n installed globally
n8n start # This will generate the ~/.n8n directory
Install dependencies and build the node:
pnpm install
pnpm run build
Create the custom
directory inside ~/.n8n
(if it doesn't exist), then symlink your local node package:
mkdir -p ~/.n8n/custom
ln -s /full/path/to/n8n-nodes-apify ~/.n8n/custom/n8n-nodes-apify # replace full/path/to with the path to your n8n-nodes-apify directory
Note: Use the absolute path in the symlink for compatibility.
Now that your custom node is linked, start n8n again:
n8n start
If you make any changes to your custom node locally, remember to rebuild and restart:
pnpm run build
n8n start
This configuration is required for our service's trigger functionality to work correctly.
By default, when running locally n8n generates webhook URLs using localhost
, which external services cannot reach. To fix this:
- Set your webhook URL
In the same shell or Docker environment where n8n runs, export theWEBHOOK_URL
to a publicly-accessible address. For example:
export WEBHOOK_URL="https://your-tunnel.local"
- Restart n8n
pnpm run build
n8n start
This node supports a wide range of Apify operations, organized by resource type:
- Run Actor: Execute an Actor with optional input parameters
- Default behavior: Uses predefined input values
- Custom input: Provide JSON object to override any or all default parameters.
- Configurable timeout and memory limits
- Build version selection
- Scrape Single URL: Quick scraping of a single URL
- Get Last Run: Retrieve information about the most recent Actor run
- Run Task: Execute a predefined Actor task
- Supports custom input JSON
- Configurable timeout
- Task-specific settings
- Get User Runs List: List all runs for a user
- Pagination support
- Sorting options
- Status filtering
- Get Run: Retrieve detailed information about a specific run
- Get Items: Fetch items from a dataset
- Get Key-Value Store Record: Retrieve a specific record by key
Automatically start an n8n workflow whenever an Actor or task finishes execution
- Can be configured to trigger on success, failure, abort, timeout or any combination of these states
- Includes run metadata in the output
- Available triggers:
- Actor Run Finished: Start a workflow when an Actor run completes
- Task Run Finished: Start a workflow when a task run completes
The node supports two authentication methods:
-
API key authentication
- Configure your Apify API key in the n8n credentials section under
apifyApi
- Configure your Apify API key in the n8n credentials section under
-
OAuth2 authentication (available only in n8n cloud)
- Configure OAuth2 credentials in the n8n credentials section under
apifyOAuth2Api
- Configure OAuth2 credentials in the n8n credentials section under
This node has been tested with n8n version 1.57.0.
- Create an Actor: Set up a new Actor on Apify.
- Set up a workflow: Create a new workflow in n8n.
- Add the Apify node: Insert the Apify node into your workflow.
- Configure credentials: Enter your Apify API key and Actor ID.
- Select an operation: Choose the desired operation for the node.
- Execute the workflow: Run the workflow to execute the Apify operation.
This project uses a GitHub Actions workflow to automate the release process, including publishing to npm. Here's how to trigger a new release.
Prerequisites (for all methods):
- Ensure your target branch on GitHub is up-to-date with all changes you want to include in the release.
- Decide on the new version number, following semantic versioning (e.g.,
vX.Y.Z
). - Prepare your release notes detailing the changes.
- If you're using CLI to release, make sure you have the GitHub CLI (
gh
) installed and authenticated (gh auth login
).
-
Navigate to GitHub Releases:
- Go to your repository’s "Releases" tab
-
Draft a New Release:
- Click the “Draft a new release” button.
-
Create or Choose a Tag:
- In the “Choose a tag” dropdown:
- Type your new tag name (e.g.,
v1.2.3
). - If the tag doesn't exist, GitHub will prompt you with an option like “Create new tag: v1.2.3 on publish.” Click this.
- Ensure the target branch selected for creating the new tag is correct. This tag will point to the latest commit on this target branch.
- Type your new tag name (e.g.,
- In the “Choose a tag” dropdown:
-
Set Release Title and Notes:
- Set the "Release title" (e.g.,
vX.Y.Z
or a more descriptive title). - For the release notes in the description field, you have a few options:
- Write your prepared release notes.
- Click the "Generate release notes" button: GitHub will attempt to automatically create release notes based on merged pull requests since the last release. You can then review and edit these auto-generated notes.
- Set the "Release title" (e.g.,
-
Publish the Release:
- Click the “Publish release” button.
Upon publishing, GitHub creates the tag from your specified branch and then creates the release. This "published" release event triggers the automated workflow.
This method uses the GitHub CLI (gh
) for all steps, including tag creation.
-
Ensure your local target branch is synced and changes are pushed:
git checkout master git pull origin master
-
Create the Release (which also creates and pushes the tag): Replace
vX.Y.Z
with your desired tag/version. The command will create this tag from the latest commit of your specified--target
branch (defaults to repository's default branch, if--target
is omitted and the branch is up to date).gh release create vX.Y.Z \ --target master \ --title "vX.Y.Z" \ --notes "Your detailed release notes here. - Feature X - Bugfix Y" # Or, to use notes from a file: gh release create vX.Y.Z \ --target master \ --title "vX.Y.Z" \ --notes-file ./RELEASE_NOTES.md # Or, to generate notes from pull requests (commits must follow conventional commit format for best results): gh release create vX.Y.Z \ --target master \ --title "vX.Y.Z" --generate-notes
vX.Y.Z
: The tag and release name.--target <branch>
: Specifies which branch the tag should be created from (e.g.,master
). If the tagvX.Y.Z
doesn't exist,gh
will create it based on the HEAD of this target branch and push it.--title "<title>"
: The title for your release.--notes "<notes>"
or--notes-file <filepath>
or--generate-notes
: Your release notes.
This command will create the tag, push it to GitHub, and then publish the release. This "published" release event triggers the automated workflow.
Regardless of how you create and publish the GitHub Release:
-
Automated Workflow Execution:
- The "Release & Publish" GitHub Actions workflow will automatically trigger.
- It will perform:
- Code checkout.
- Version extraction (
X.Y.Z
) from the release tag. - Build and test processes.
- Update
package.json
andpnpm-lock.yaml
to versionX.Y.Z
. - Commit these version changes back to the branch the release was targeted from with a message like
chore(release): set version to X.Y.Z [skip ci]
. - Publish the package
@apify/n8n-nodes-apify@X.Y.Z
to npm.
-
Verify the Package on npm: After the workflow successfully completes (check the "Actions" tab in your GitHub repository):
- Verify the new version on npm:
This should print
pnpm view @apify/n8n-nodes-apify version
X.Y.Z
.
- Verify the new version on npm:
Track changes and updates to the node here.
-
Authentication errors
- Verify your API key is correct
-
Resource Not Found
- Verify the resource ID format
- Check if the resource exists in your Apify account
- Ensure you have access to the resource
-
Operation failures
- Check the input parameters
- Verify resource limits (memory, timeout)
- Review Apify Console for detailed error messages
If you encounter issues:
- Check the Apify API documentation
- Review the n8n Community Nodes documentation
- Open an issue in the GitHub repository