AWS ECS icon

AWS ECS

Consume the AWS ECS API

Overview

The AWS ECS - List Tasks operation node allows you to retrieve a list of tasks from an Amazon Elastic Container Service (ECS) cluster. This is useful for monitoring, auditing, or automating workflows that depend on the state of ECS tasks. Common scenarios include:

  • Monitoring which tasks are currently running, pending, or stopped in a specific ECS cluster.
  • Triggering follow-up actions based on the status of tasks (e.g., alerting if tasks are stopped unexpectedly).
  • Integrating ECS task information into broader automation pipelines.

Example use cases:

  • Automatically check for failed (stopped) tasks and notify your team.
  • List all running tasks before performing a deployment or update.
  • Audit ECS usage by listing all tasks across clusters.

Properties

Name Type Meaning
Launch Type options The infrastructure to run your standalone task on. Options: EC2 (Amazon EC2 instances), Fargate (Fargate On-Demand infrastructure), External (on-premises server/VM). Required for this operation.
Cluster string The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. If not specified, the default cluster is assumed.
Desired Status options The task desired status to use when filtering the results. Options: Pending, Running, Stopped. Default is Running. Useful for debugging or monitoring specific task states.

Output

The json output field contains the response from the AWS ECS listTasks API call. The structure typically includes:

{
  "taskArns": [
    "arn:aws:ecs:region:account-id:task/cluster-name/task-id",
    ...
  ],
  "nextToken": "string" // (optional, for pagination)
}
  • taskArns: An array of task ARNs matching the filter criteria.
  • nextToken: (Optional) Token for paginating results if there are more tasks than can be returned in a single response.

No binary data is output by this operation.

Dependencies

  • AWS Credentials: Requires valid AWS access key ID, secret access key, and region configured in n8n credentials.
  • External Service: Access to the AWS ECS API.
  • n8n Configuration: The node must be configured with the appropriate AWS credentials.

Troubleshooting

Common Issues:

  • Invalid Credentials: If AWS credentials are incorrect or lack permissions, the node will throw authentication or authorization errors.
  • Cluster Not Found: Specifying a non-existent cluster ARN or name will result in an error.
  • API Rate Limits: Excessive requests may trigger AWS rate limiting.

Error Messages:

  • "Operation \"<operation>\" not supported!": Occurs if an unsupported operation is selected.
  • AWS SDK errors (e.g., AccessDeniedException, ClusterNotFoundException): Check your credentials and cluster names.
  • "Missing required parameter": Ensure all required fields (like Launch Type) are filled.

How to resolve:

  • Double-check AWS credentials and permissions.
  • Verify the cluster name/ARN exists in your AWS account.
  • Ensure all required properties are set in the node configuration.

Links and References

Discussion