Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node integrates with Docker through the Portainer API, specifically focusing on retrieving system events from a selected Docker endpoint managed by Portainer. It is useful for monitoring Docker system activities such as container lifecycle events, image changes, network modifications, and other Docker-related events in real-time or within a specified time range.

Typical use cases include:

  • Tracking container start, stop, or crash events to trigger alerts or automated workflows.
  • Auditing Docker resource changes over time.
  • Filtering specific event types or resources to monitor targeted aspects of a Docker environment.

For example, you could configure this node to stream all container-related events since a certain timestamp to keep an up-to-date log or trigger downstream processes when particular events occur.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint managed by Portainer to query events from. You can select from a list of available endpoints or specify an ID using an expression. This determines which Docker environment the node will interact with.
Additional Fields A collection of optional parameters to refine the event query:
- Since Timestamp to show events created since this time and then stream new events continuously. Useful for real-time monitoring starting from a specific point.
- Until Timestamp to show events created until this time and then stop streaming. Allows limiting the event retrieval window.
- Filters JSON encoded filters to narrow down the event list based on various criteria such as config name/ID, container name/ID, daemon, event type, image, label, network, node, plugin, scope (local or swarm), secret, service, type (container, image, volume, etc.), or volume name. This enables precise targeting of relevant events.

Output

The node outputs JSON data representing Docker system events retrieved from the specified endpoint. Each event object typically contains details such as event type, involved resource identifiers, timestamps, and other metadata describing the Docker system activity.

If streaming is enabled (using the "Since" field), the node continuously outputs new events as they occur.

No binary data output is indicated.

Dependencies

  • Requires access to a Portainer API instance managing Docker endpoints.
  • Needs an API authentication token or key configured in n8n credentials to authenticate requests to the Portainer API.
  • The node dynamically loads available Docker endpoints from Portainer to populate the endpoint selection property.

Troubleshooting

  • Common issues:

    • Incorrect or missing endpoint ID may cause failures to retrieve events.
    • Invalid or expired API credentials will result in authentication errors.
    • Malformed JSON in the filters field can cause request errors.
    • Network connectivity issues between n8n and the Portainer API server.
  • Error messages and resolutions:

    • Authentication errors: Verify that the API key/token credential is correctly set and has sufficient permissions.
    • Endpoint not found: Ensure the selected endpoint exists and is accessible via Portainer.
    • Invalid filter format: Confirm that the filters input is valid JSON matching expected structure.
    • Timeout or connection refused: Check network settings and Portainer API availability.

Links and References

Discussion