Portainer icon

Portainer

Interact with Portainer via API

Actions190

Stacks → Stack Stop

AI-generated

Overview

The "Stack Stop" operation in the Stacks resource allows users to stop a specific stack within an environment managed by Portainer. This node is useful for automating the management of containerized applications, particularly when you need to programmatically halt running stacks as part of deployment workflows, maintenance tasks, or scaling down services.

For example, you might use this node to stop a development stack after testing is complete or to temporarily disable a production stack during updates.

Properties

Name Meaning
Id Stack identifier (number)
Endpoint Id Environment identifier (number)
  • Id: The unique numeric identifier of the stack you want to stop.
  • Endpoint Id: The numeric identifier of the environment where the stack is deployed. This is sent as a query parameter in the API request.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to stop the specified stack. Typically, this will include status information about the operation's success or failure.

No binary data output is expected from this operation.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The node expects the base URL of the Portainer instance to be configured in the credentials.
  • The node uses the Portainer REST API endpoint /api to perform operations.

Troubleshooting

  • Common issues:

    • Invalid or missing stack ID or endpoint ID can cause the operation to fail.
    • Network connectivity problems or incorrect Portainer URL configuration may prevent API calls.
    • Insufficient permissions associated with the API key can result in authorization errors.
  • Error messages:

    • "Stack not found": Verify that the provided stack ID exists in the specified environment.
    • "Unauthorized" or "Forbidden": Check that the API key has sufficient rights to manage stacks.
    • "Network Error": Confirm that the Portainer URL is correct and accessible from n8n.

Resolving these typically involves verifying input parameters, ensuring proper credential setup, and confirming network access.

Links and References

Discussion