Portainer icon

Portainer

Interact with Portainer via API

Actions190

Custom Templates → Custom Template Create Repository

AI-generated

Overview

This node operation, Custom Template Create Repository, allows users to create a new repository using a custom template within the Portainer environment. It is useful for automating the creation of repositories based on predefined templates, which can streamline deployment workflows and ensure consistency across projects.

Typical use cases include:

  • Automating repository setup in container management or DevOps pipelines.
  • Creating standardized project repositories with predefined configurations.
  • Integrating repository creation into larger automation workflows in n8n.

Properties

Name Meaning
Body The JSON string body containing the details required to create the repository. This is mandatory when performing the repository creation operation. The content should conform to the API's expected schema for repository creation.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to create the repository. This typically includes information about the newly created repository such as its ID, name, status, and any relevant metadata returned by the API.

If the API supports binary data output (not indicated here), it would be summarized accordingly, but this operation primarily deals with JSON responses.

Dependencies

  • Requires an active connection to a Portainer instance via its API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The base URL for the Portainer API must be set correctly in the node credentials.

Troubleshooting

  • Invalid or missing body: Since the "Body" property is required, omitting it or providing malformed JSON will cause errors. Ensure the JSON string is valid and matches the API schema.
  • Authentication errors: If the API key or token is incorrect or expired, the node will fail to authenticate. Verify credentials and permissions.
  • API endpoint issues: Incorrect base URL or network connectivity problems can prevent successful API calls. Confirm the Portainer URL and network access.
  • Unexpected API responses: If the API changes or returns errors, check the response message for clues and update the request body accordingly.

Links and References

Discussion