Portainer icon

Portainer

Interact with Portainer via API

Actions190

Edge Stacks → Edge Stack Create String

AI-generated

Overview

This node operation allows you to create an Edge Stack in Portainer by providing the stack configuration as a raw string. It is useful when you want to programmatically deploy or test edge stacks by sending the full stack definition directly, without needing to upload files or use predefined templates.

Common scenarios include:

  • Automating deployment of containerized applications on edge devices managed by Portainer.
  • Testing stack configurations before actual deployment using the dry run option.
  • Integrating with CI/CD pipelines where stack definitions are generated dynamically.

Example: You can pass a Docker Compose YAML string defining your services and volumes, and the node will create the corresponding Edge Stack in Portainer.

Properties

Name Meaning
Body The stack configuration as a raw string (e.g., Docker Compose YAML). This is the main content sent to create the edge stack.
Additional Fields Optional extra parameters for the request. Currently supports:
- Dryrun If set to true, the node will validate the stack configuration without creating it, returning a non-persisted edge stack object instead.

Output

The node outputs JSON data representing the created Edge Stack object returned from the Portainer API. This typically includes details such as stack ID, name, status, and configuration metadata.

No binary data output is produced by this operation.

Dependencies

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

Troubleshooting

  • Invalid stack configuration: If the stack config string is malformed or contains errors, the API may reject the request. Use the "Dryrun" option to validate the config before creation.
  • Authentication errors: Ensure the API key/token credential is valid and has sufficient permissions to create edge stacks.
  • Network issues: Verify connectivity to the Portainer server and that the base URL is correct.
  • Empty body: The "Body" property is required; leaving it empty will cause the request to fail.

Links and References

Discussion