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 networks within a specified environment (endpoint). Specifically, the Network - Delete operation allows users to delete a Docker network by its ID from a given environment. This is useful for cleaning up unused or obsolete networks in Docker environments managed via Portainer.
Practical scenarios include:
- Automating cleanup of Docker networks that are no longer needed.
- Integrating network deletion into CI/CD pipelines or infrastructure automation workflows.
- Managing multiple Docker environments/endpoints centrally through Portainer.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the network exists. |
| Network ID | The unique identifier of the Docker network to be deleted. |
| Force Delete | Whether to force deletion even if the network is currently in use (boolean: true/false). |
Output
The node outputs JSON data representing the response from the Portainer API after attempting to delete the specified network. Typically, this will confirm successful deletion or provide error details if the operation failed.
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 and API key must be set in the node credentials for proper communication.
Troubleshooting
Common Issues:
- Invalid or missing Environment ID or Network ID parameters will cause the request to fail.
- Attempting to delete a network that is currently in use without setting "Force Delete" may result in an error.
- Network ID not found or already deleted will return an error from the API.
- Insufficient permissions or invalid API key can cause authorization errors.
Error Messages & Resolutions:
- 404 Not Found: Verify the Network ID and Environment ID are correct and exist.
- 403 Forbidden / Unauthorized: Check that the API key has sufficient permissions.
- Conflict/Error due to network in use: Enable "Force Delete" if you intend to forcibly remove the network.
- Connection errors: Ensure the Portainer base URL is reachable and the API key is valid.