Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node interacts with Docker through the Portainer API, specifically allowing users to list Docker services on a selected endpoint. It is useful for scenarios where you want to automate monitoring or management of Docker services running in your infrastructure managed by Portainer. For example, you can retrieve all services filtered by specific criteria or include their status information (running and desired tasks count) to integrate with dashboards, alerts, or further automation workflows.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint managed by Portainer where the service list will be fetched from. You can select from a dynamically loaded list of endpoints or specify an ID using an expression.
Additional Fields Optional extra parameters to refine the service list query:
- Filters JSON encoded filters to narrow down the services returned. Supported filters include service id, label, mode (either "replicated" or "global"), and name.
- Status Boolean flag indicating whether to include service status details such as counts of running and desired tasks. Defaults to true.

Output

The node outputs a JSON array of Docker services retrieved from the specified endpoint. Each item in the output contains detailed information about a service, including its metadata and optionally its status if requested. This data can be used downstream in workflows for reporting, decision-making, or triggering other actions.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Portainer instance with the Docker environment configured.
  • Needs an API key credential for authenticating requests to the Portainer API.
  • The node uses the Portainer API endpoint /api/endpoints/{endpointId}/docker/services to fetch the service list.
  • The base URL and authentication credentials must be configured in n8n credentials for Portainer.

Troubleshooting

  • Common issues:
    • Incorrect or missing endpoint ID will cause the request to fail; ensure the endpoint exists and is accessible.
    • Invalid JSON format in the Filters field may cause errors; verify the JSON syntax carefully.
    • Network connectivity problems between n8n and the Portainer server can prevent successful API calls.
  • Error messages:
    • Authentication errors indicate invalid or missing API credentials; check and update the API key.
    • 404 or 400 HTTP errors usually mean incorrect endpoint ID or malformed query parameters; verify inputs.
    • Timeout or connection refused errors suggest network or firewall issues blocking access to Portainer.

Links and References

Discussion