Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node allows you to create a new webhook in Portainer, a management tool for Docker environments. Specifically, the "Webhook: Create" operation lets you register a webhook associated with a specific resource and environment within Portainer.

Use cases include automating actions triggered by events in your Docker infrastructure managed via Portainer. For example, you might create a webhook that triggers a CI/CD pipeline when a service or stack is updated, or to notify external systems about changes in your containerized applications.

Practical example:

  • You want to create a webhook linked to a particular Docker service or stack so that whenever an event occurs (like deployment or update), an external system receives a notification or triggers further automation.

Properties

Name Meaning
Resource ID The identifier of the resource to which the webhook will be attached.
Webhook Type The type of webhook to create. Options are:
- Service (value 1)
- Stack (value 2)

Output

The node outputs JSON data representing the created webhook object as returned by the Portainer API. This typically includes details such as the webhook's unique ID, associated resource ID, endpoint ID, webhook type, and other metadata confirming successful creation.

No binary data output is involved.

Dependencies

  • Requires connection to a Portainer instance via its API.
  • Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
  • The base URL of the Portainer API must be set in the credentials.

Troubleshooting

  • Invalid Resource ID: If the provided resource ID does not exist or is incorrect, the API will likely return an error. Verify the resource ID corresponds to an existing resource in Portainer.
  • Authentication Errors: Ensure the API key credential is valid and has sufficient permissions to create webhooks.
  • Incorrect Webhook Type: Use only the allowed values (1 for Service, 2 for Stack). Invalid values may cause request failures.
  • Network Issues: Confirm that n8n can reach the Portainer API endpoint and that there are no firewall or connectivity issues.

Common error messages usually come from the Portainer API and indicate problems like unauthorized access, resource not found, or validation errors on input parameters.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion