Actions15
Overview
This n8n node allows you to run a command inside a Docker image by pulling the specified image and executing the provided command. It is useful for automating tasks that require running scripts, binaries, or tools within isolated Docker containers directly from your n8n workflows.
Common scenarios:
- Running CLI tools or scripts in a controlled environment.
- Automating build, test, or deployment steps using containerized applications.
- Processing files or data with utilities available only in certain Docker images.
Practical example:
You could use this node to run an ffmpeg
command inside an official ffmpeg
Docker image to process media files, or execute a Python script in a python:3.10
image without installing Python on your host.
Properties
Name | Meaning |
---|---|
Image | The name (and optionally tag) of the Docker image to pull and run (e.g., alpine:latest ). |
Command | A JSON array representing the command and its arguments to execute inside the container. Example: ["echo", "Hello World"] |
Output
The node outputs a JSON object with the following fields:
{
"stdout": "<string containing standard output from the command>",
"stderr": "<string containing standard error output from the command>"
}
- stdout: Captures everything written to standard output by the command.
- stderr: Captures everything written to standard error by the command.
No binary data is produced by this operation.
Dependencies
- Docker Daemon/API: The node requires access to a Docker daemon, typically via local or remote Docker API.
- Credentials: You must configure Docker credentials in n8n (
dockerCredentialsApi
). - n8n Configuration: Ensure the n8n instance can reach the Docker host (network/firewall).
Troubleshooting
Common issues:
"No credentials got returned!"
This error means the node could not retrieve Docker credentials. Make sure you have set up Docker credentials in n8n and selected them in the node configuration."Command must be an array!"
TheCommand
property must be a valid JSON array (e.g.,["ls", "-la"]
). If you enter a string or invalid JSON, you'll get this error.Image not found / Pull errors
If the specified image does not exist or cannot be pulled (due to network issues or authentication), the node will fail. Double-check the image name and ensure the Docker host has internet access or access to the required registry.Permission denied / Docker connection errors
If n8n cannot connect to Docker (wrong socket path, missing permissions), the node will fail. Ensure the user running n8n has permission to access the Docker daemon.