Docker Executor icon

Docker Executor

Execute with Docker

Overview

This node allows executing tasks inside Docker containers within an n8n workflow. It supports running commands or processes using a specified Docker image, either by creating a new stateless container for each execution or by reusing the same container across executions. This flexibility makes it useful for workflows that require isolated environments or consistent container states.

Common scenarios include:

  • Running custom scripts or applications packaged as Docker images.
  • Isolating execution environments to avoid dependency conflicts.
  • Debugging or testing code in a controlled containerized environment.
  • Automating container-based tasks such as builds, tests, or deployments.

For example, you could use this node to run a data processing script inside a Docker container with all dependencies pre-installed, ensuring consistent results regardless of the host system.

Properties

Name Meaning
Image Docker image to use for the container (e.g., registry.yoshino-s.xyz/yoshino-s/soar-image:dev).
Stateless Whether to use a stateless container (true) which means any available container can be used, or false to reuse the same container for all executions.
Container When Stateless is false, select the specific container to use from a list of existing containers.
Debug Mode Enable to see more detailed information in the node's input and output for troubleshooting purposes.

Output

The node outputs data through an executor connection type, which typically includes the result of the command or process executed inside the Docker container. The exact structure depends on the executed task but generally contains JSON data representing the execution response.

If debug mode is enabled, additional diagnostic information about the container execution may be included in the output.

No binary data output is indicated by the source code.

Dependencies

  • Requires access to a Docker API endpoint authenticated via an API key credential configured in n8n.
  • The Docker image specified must be accessible (public or private registry with proper authentication).
  • For non-stateless mode, requires selecting an existing Docker container by its ID.

Troubleshooting

  • Container not found: If Stateless is false and the selected container ID does not exist or is not running, the node will fail. Ensure the container exists and is accessible.
  • Image pull issues: If the specified Docker image cannot be pulled (due to network issues or authentication), execution will fail. Verify image name and registry access.
  • Permission errors: The Docker API credentials must have sufficient permissions to create or manage containers.
  • Debug mode: Enable Debug Mode to get more detailed logs and help diagnose issues related to container execution.

Links and References

Discussion