Actions72
- Image Actions
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Stack Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Overview
This node integrates with the Portainer API to manage Docker Swarm services. Specifically, the Service - Get operation retrieves detailed information about a specific Docker Swarm service identified by its Service ID within a given environment (endpoint). This is useful for monitoring, auditing, or automating workflows that depend on the current state or configuration of Docker services managed via Portainer.
Common scenarios:
- Fetching service details before performing updates or scaling operations.
- Auditing service configurations in automated CI/CD pipelines.
- Integrating Docker service metadata into dashboards or reports.
Practical example:
You want to retrieve the configuration and status of a Docker Swarm service named "webapp" running in your production environment (Environment ID 1). Using this node, you provide the Environment ID and the Service ID, and it returns the full JSON representation of that service as stored in Portainer.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the Docker service is deployed. |
| Service ID | The unique identifier of the Docker Swarm service to retrieve information about. |
Output
The node outputs a JSON object representing the full details of the specified Docker Swarm service as returned by the Portainer API. This includes all service configuration, status, task templates, endpoint specifications, mode (replicated/global), update status, and other metadata.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to a Portainer instance with API access.
- Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
- The base URL of the Portainer API must be set in the credentials.
- The target environment (endpoint) must exist in Portainer, and the user must have permission to access it.
Troubleshooting
Common issues:
- Invalid or missing Environment ID or Service ID will cause the request to fail.
- Incorrect API key or insufficient permissions may result in authentication errors.
- Network connectivity issues to the Portainer server can cause timeouts or connection failures.
- If the Service ID does not exist in the specified environment, a "not found" error will occur.
Error messages and resolutions:
- 401 Unauthorized: Check that the API key credential is correct and has sufficient permissions.
- 404 Not Found: Verify that the Service ID and Environment ID are correct and that the service exists.
- 500 Internal Server Error: May indicate issues on the Portainer server; retry later or check server logs.
- Network errors: Ensure the Portainer base URL is reachable from the n8n instance.