Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker-related resources. Specifically, for the Template - Get operation, it retrieves detailed information about a specific application template by its ID from Portainer. This is useful when you want to fetch metadata or configuration details of a particular template stored in Portainer for automation, auditing, or deployment purposes.

Common scenarios:

  • Automating retrieval of application templates before deploying containers or stacks.
  • Fetching template details to display or log them in workflows.
  • Integrating Portainer template data into other systems or dashboards.

Example:
You have a workflow that deploys applications based on predefined templates in Portainer. Before deployment, you use this node to get the template details by specifying its Template ID, then use that data to configure your deployment steps.

Properties

Name Meaning
Template ID The unique identifier of the template to retrieve. This is required and should be provided as a string (e.g., "1").

Output

The node outputs the JSON response from the Portainer API corresponding to the requested template. The structure typically includes all properties of the template such as its name, description, version, associated stack file content, and other metadata defined in Portainer.

  • The output is available in the json field of the node's output.
  • No binary data is produced by this operation.

Dependencies

  • Requires an active connection to a Portainer instance via its API.
  • Needs an API key credential configured in n8n to authenticate requests to Portainer.
  • The base URL of the Portainer API must be set in the credentials.
  • The node uses HTTP GET requests to /templates/{templateId} endpoint of the Portainer API.

Troubleshooting

  • Invalid Template ID: If the provided Template ID does not exist or is incorrect, the API will likely return a 404 error. Verify the Template ID is correct.
  • Authentication errors: Ensure the API key credential is valid and has sufficient permissions to access templates.
  • Connection issues: Confirm the Portainer base URL is reachable from the n8n environment.
  • Empty response: If the template exists but returns empty data, check if the template is properly configured in Portainer.

Links and References

Discussion