Overview
The AWS ECS - Stop Task operation in this n8n node allows you to stop a running task in Amazon Elastic Container Service (ECS). This is useful for managing containerized workloads, such as terminating tasks that are no longer needed, stopping malfunctioning containers, or implementing custom scaling and scheduling logic.
Common scenarios:
- Stopping a specific ECS task by its ID or ARN.
- Automating cleanup of resources after a workflow completes.
- Integrating with monitoring tools to stop unhealthy tasks automatically.
Example use cases:
- Automatically stop a long-running batch job after completion.
- Terminate a task if an error condition is detected elsewhere in your workflow.
- Implement manual or scheduled shutdowns of ECS tasks from within n8n.
Properties
| Name | Type | Meaning |
|---|---|---|
| Cluster | String | The short name or full Amazon Resource Name (ARN) of the ECS cluster where the task is running. If not specified, the default cluster is assumed. |
| Task | String | (Required) The task ID or full ARN of the ECS task to stop. |
| Reason | String | An optional message describing why the task is being stopped. This message appears in subsequent DescribeTasks API calls for auditing or debugging purposes. Up to 255 characters allowed. |
Output
The node outputs a json object containing the response from the AWS ECS stopTask API call. The structure typically includes:
{
"task": {
// Details about the stopped task, such as:
"taskArn": "...",
"clusterArn": "...",
"lastStatus": "STOPPED",
"desiredStatus": "STOPPED",
"stoppedReason": "...",
// ...other ECS task fields
}
}
- The exact fields depend on the AWS ECS API response, but you can expect information about the task's status, reason for stopping, and identifiers.
Dependencies
- AWS Account: You must have valid AWS credentials (Access Key ID, Secret Access Key, and Region) configured in n8n.
- n8n Credentials: The node requires an AWS credential set named
aws. - External Service: Requires access to the AWS ECS service via the AWS SDK.
Troubleshooting
Common issues:
- Invalid credentials: If your AWS credentials are incorrect or lack permissions for ECS actions, the node will throw authentication or authorization errors.
- Task not found: If the provided Task ID/ARN does not exist or is already stopped, AWS will return an error.
- Cluster not found: If the specified cluster does not exist, you'll receive a resource not found error.
- Reason too long: If the "Reason" field exceeds 255 characters, AWS will reject the request.
Error messages:
"Operation \"<operation>\" not supported!"— Make sure you selected the correct operation.- AWS SDK errors (e.g.,
ResourceNotFoundException,AccessDeniedException) — Check your input values and AWS permissions.
How to resolve:
- Double-check your AWS credentials and permissions.
- Ensure the Task and Cluster values are correct and exist in your AWS account.
- Keep the Reason message concise (under 255 characters).