Actions107
- Node Actions
- Network Actions
- Container Actions
- Container List
- Container Create
- Container Inspect
- Container Top
- Container Logs
- Container Changes
- Container Export
- Container Stats
- Container Resize
- Container Start
- Container Stop
- Container Restart
- Container Kill
- Container Update
- Container Rename
- Container Pause
- Container Unpause
- Container Attach
- Container Attach Websocket
- Container Wait
- Container Delete
- Container Archive Info
- Container Archive
- Put Container Archive
- Container Prune
- Image Actions
- Volume Actions
- Swarm Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
- Config Actions
- Plugin Actions
- Distribution Actions
- Session Actions
Overview
This node allows you to interact with Docker through the Portainer API, specifically focusing on managing Docker Swarm clusters. The "Swarm Init" operation initializes a new Docker Swarm on a specified endpoint. This is useful when setting up a new swarm cluster for container orchestration and management.
Typical use cases include:
- Automating the creation of Docker Swarm clusters as part of infrastructure provisioning.
- Integrating swarm initialization into CI/CD pipelines.
- Managing multiple Docker environments via Portainer from within n8n workflows.
Properties
| Name | Meaning |
|---|---|
| EndpointID Name or ID | Select or specify the target Docker endpoint (Portainer environment) where the swarm will be initialized. Options are dynamically loaded from available endpoints. |
| Body | JSON string containing the swarm initialization configuration parameters as required by the Docker API. |
Output
The node outputs JSON data representing the response from the Portainer API after attempting to initialize the Docker Swarm. This typically includes details about the newly created swarm cluster or error information if the operation failed.
No binary data output is produced by this node.
Dependencies
- Requires access to a Portainer instance with API enabled.
- Needs an API authentication token configured in n8n credentials to authenticate requests to Portainer.
- The node depends on the Portainer API endpoint
/api/endpoints/{endpointId}/docker/swarm/initto perform the swarm initialization.
Troubleshooting
- Invalid EndpointID: If the selected endpoint does not exist or is unreachable, the node will fail. Ensure the endpoint ID is correct and the Portainer instance is accessible.
- Malformed Body JSON: The "Body" property must be a valid JSON string matching the Docker Swarm init API schema. Invalid JSON or missing required fields will cause errors.
- Authentication Errors: Missing or incorrect API credentials will result in authorization failures. Verify that the API key/token is correctly set up in n8n.
- Portainer API Errors: Any errors returned by the Portainer API (e.g., swarm already initialized, network issues) will be passed through. Review the error message for specific causes.