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 secrets. Specifically, the Secret - Get operation retrieves detailed information about a specific Docker Swarm secret by its ID within a given Portainer environment (endpoint). This is useful for users who want to programmatically access metadata and configuration details of secrets stored in their Docker Swarm clusters managed via Portainer.
Typical use cases include:
- Auditing or inspecting secrets used in your Docker Swarm services.
- Automating workflows that require fetching secret details before deployment or updates.
- Integrating secret management into broader CI/CD pipelines or infrastructure automation.
Example: You have a secret containing database credentials stored in Docker Swarm. Using this node, you can fetch the secret's metadata and verify its existence or properties before deploying an application that depends on it.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the secret resides. |
| Secret ID | The unique identifier of the Docker Swarm secret to retrieve. |
Output
The node outputs the JSON response from the Portainer API representing the requested secret. This JSON typically includes:
- Metadata about the secret such as its ID, name, creation date, labels, and version.
- Details necessary to identify and manage the secret within Docker Swarm.
No binary data output is involved in this operation.
Dependencies
Requires a configured Portainer API credential with:
- Base URL of the Portainer instance.
- An API key token for authentication.
The node makes HTTP GET requests to the Portainer API endpoint
/endpoints/{environmentId}/docker/secrets/{secretId}.Ensure the Portainer instance is accessible from the n8n environment.
Troubleshooting
Common issues:
- Invalid or missing Environment ID or Secret ID parameters will cause the request to fail.
- Network connectivity problems between n8n and the Portainer server.
- Insufficient permissions or invalid API key may result in authorization errors.
- Secret not found if the provided Secret ID does not exist in the specified environment.
Error messages:
404 Not Found: The secret with the given ID does not exist in the specified environment.401 Unauthorizedor403 Forbidden: API key is invalid or lacks permission.500 Internal Server Error: Issue on the Portainer server side; check server logs.
Resolutions:
- Verify that the Environment ID and Secret ID are correct.
- Confirm the API key credential is valid and has sufficient privileges.
- Check network connectivity and firewall settings.
- Consult Portainer logs for server-side errors.