Actions72
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Stack Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
Overview
The node provides integration with the Portainer API, enabling management of Docker environments and Docker Swarm resources. Specifically, the "Node" resource with the "Get Many" operation allows users to retrieve a list of all Docker Swarm nodes within a specified environment (endpoint) managed by Portainer.
This functionality is useful for scenarios where you need to monitor or audit the nodes in your Docker Swarm cluster, automate infrastructure management tasks, or integrate node information into broader workflows such as deployment pipelines or monitoring dashboards.
Practical example:
You can use this node operation to fetch all nodes in a Docker Swarm cluster to check their status, roles, or labels before performing updates or scaling operations on services running in the cluster.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the Docker Swarm nodes are managed. |
- This property is required.
- It specifies which Docker environment's nodes will be listed.
Output
The output of the "Get Many" operation for the "Node" resource is a JSON array containing objects representing each Docker Swarm node in the specified environment. Each object includes details about the node such as its ID, status, role, availability, labels, and other metadata as provided by the Portainer API.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to a Portainer instance with API access.
- Requires an API key credential configured in n8n to authenticate requests to the Portainer API.
- The node uses the base URL and API key from the configured credentials to make HTTP GET requests to the endpoint
/endpoints/{environmentId}/docker/nodes.
Troubleshooting
Common issues:
- Invalid or missing Environment ID: Ensure the environment ID corresponds to a valid Portainer endpoint.
- Authentication errors: Verify that the API key credential is correctly set up and has sufficient permissions.
- Network connectivity: Confirm that n8n can reach the Portainer API URL.
Error messages:
- Unauthorized or 401 errors indicate invalid API key or insufficient permissions.
- 404 Not Found may indicate the environment ID does not exist.
- Timeout or network errors suggest connectivity problems.
Resolutions:
- Double-check the environment ID and API key.
- Test API access outside n8n using tools like curl or Postman.
- Ensure the Portainer server is reachable from the n8n host.