Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker resources, specifically here focusing on the Stack resource with the Get operation. It allows users to retrieve detailed information about a specific Docker stack managed by Portainer.

Typical use cases include:

  • Fetching the configuration and status of a particular Docker Compose stack deployed via Portainer.
  • Automating monitoring or auditing workflows that require stack details.
  • Integrating stack data retrieval into larger automation pipelines for Docker environment management.

For example, you might use this node to get the current state and configuration of a stack before performing updates or deployments.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the stack is deployed.
Stack ID The unique identifier of the stack to retrieve information about.

These properties are required to specify which stack in which environment you want to fetch.

Output

The node outputs JSON data representing the full details of the specified stack as returned by the Portainer API. This typically includes:

  • Stack metadata (ID, name, creation date).
  • Configuration details such as the docker-compose file content.
  • Associated environment variables.
  • Status and deployment information.

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.
  • The base URL of the Portainer API must be set in the credentials.

Troubleshooting

  • Common issues:

    • Invalid or missing Environment ID or Stack ID will cause the request to fail.
    • Incorrect API key or insufficient permissions may result in authentication errors.
    • Network connectivity problems to the Portainer server can cause timeouts or connection errors.
  • Error messages:

    • 404 Not Found: The specified stack or environment does not exist. Verify IDs.
    • 401 Unauthorized: Authentication failed. Check API key validity and permissions.
    • 500 Internal Server Error: Server-side issue; retry later or check Portainer logs.

To resolve these, ensure correct input parameters, valid credentials, and network accessibility.

Links and References

Discussion