Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node allows users to delete a Docker node from a Docker swarm via the Portainer API. It is useful in scenarios where you need to programmatically remove nodes from your Docker infrastructure, such as during automated cleanup, scaling down clusters, or managing node lifecycle within container orchestration environments.

For example, if you have a Docker swarm managed through Portainer and want to remove a specific node by its ID or name, this node can perform that deletion directly from an n8n workflow.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Portainer endpoint to access. You can select from a list of available endpoints or specify an ID using an expression.
Id The ID or name of the Docker node you want to delete.
Additional Fields Optional additional parameters for the delete operation:
  Force A boolean option to forcefully remove the node from the swarm.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to delete the specified Docker node. This typically includes status information about the deletion request.

No binary data output is produced by this node.

Dependencies

  • Requires a valid Portainer API authentication token configured in n8n credentials.
  • Needs access to the Portainer API URL and the specific endpoint ID to target the correct Docker environment.
  • Uses the Portainer API's /api/endpoints/{endpointId}/docker base path for requests.

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the selected endpoint exists and is accessible.
    • Incorrect node ID or name: Verify the node identifier is correct and corresponds to an existing Docker node.
    • Insufficient permissions: The API token must have rights to delete nodes in the targeted Docker swarm.
    • Network connectivity problems with the Portainer server.
  • Error messages:

    • Authorization errors usually indicate invalid or expired API credentials.
    • 404 Not Found may mean the node ID does not exist on the specified endpoint.
    • 400 Bad Request could result from malformed parameters or unsupported options.

Resolving these generally involves verifying credentials, endpoint configuration, and input parameters.

Links and References

Discussion