Portainer icon

Portainer

Interact with Portainer via API

Actions190

Edge Stacks → Edge Stack Create Repository

AI-generated

Overview

This node operation allows you to create a new Edge Stack repository in Portainer by sending a stack configuration. It is useful for automating the deployment and management of containerized applications at the edge, where lightweight and distributed stacks are required. For example, you can use this node to programmatically deploy an application stack to multiple edge devices or environments without manually configuring each one.

Properties

Name Meaning
Body The stack configuration as a JSON string that defines the Edge Stack to be created.
Additional Fields Optional parameters to customize the request:
- Dryrun If set to true, the node will validate the stack configuration without actually creating the Edge Stack.

Output

The output contains a JSON object representing the newly created Edge Stack repository or, if dryrun is enabled, a non-persisted Edge Stack object that reflects the validation result. This JSON includes all relevant details about the stack such as its ID, name, status, and configuration.

No binary data output is produced by this node operation.

Dependencies

  • Requires an API key credential to authenticate with the Portainer API.
  • The node expects the base URL of the Portainer instance to be configured in the credentials.
  • The Portainer API must be accessible from the n8n environment.

Troubleshooting

  • Invalid stack configuration: If the provided stack config JSON in the "Body" property is malformed or missing required fields, the API may return an error. Validate your JSON before running the node.
  • Authentication errors: Ensure the API key credential is valid and has sufficient permissions to create Edge Stacks.
  • Network issues: Verify connectivity to the Portainer API endpoint.
  • Dryrun flag confusion: When using the dryrun option, no actual stack is created; only validation occurs. Make sure to disable dryrun when you want to persist the stack.

Links and References

Discussion