SAE Job lets you run containerized tasks on a schedule or on demand via HTTP/HTTPS requests. Each task runs in a dedicated instance that is automatically released when the task completes.
Use cases
SAE Job is designed for asynchronous, latency-tolerant workloads:
Time-driven processing: Send coupons on the hour, update daily earnings, or refresh daily tag counts and crowd data.
Batch data processing: Generate monthly statistical reports or run batch text message status updates where real-time performance is not required.
Asynchronous decoupling: Refresh activity statuses, run offline queries asynchronously, or decouple task logic from your application.
CI/CD pipelines: Release compute resources immediately after a continuous integration (CI) or continuous delivery (CD) task completes.
For a full comparison of SAE Job against other deployment options, see Scenarios.
Prerequisites
Before you begin, ensure that you have:
An activated SAE account
An activated EventBridge service
If you are using a Resource Access Management (RAM) user, the Alibaba Cloud account holder must also:
Activate EventBridge.
Activate SAE Job and create the
AliyunServiceRoleForEventBridgeSendToSAEservice-linked role as prompted in the console.Grant the
AliyunEventBridgeReadOnlyAccesspermission to the RAM user. See Grant permissions to a RAM user.
How it works
Create a task template that defines how a task runs (deployment method, instance type, schedule, and so on).
Trigger tasks either automatically via a cron schedule or on demand via an HTTP/HTTPS request. Each trigger creates a new task from the template.
SAE provisions a new instance to run each task and releases the instance when the task finishes.
Create a task template
On the SAE Task Templates page, select a region and a namespace in the top navigation bar, and then click Create Task Template.
On the Basic Information page, configure the following parameters and click Next.
Deploy by Image: Click Set Image and choose an image source: For details, see Deploy an application using an image.
Demo Image: A prebuilt sample image.
My Alibaba Cloud Images: Images in an Alibaba Cloud Container Registry (ACR) instance under the same account.
Private Images from Other Alibaba Cloud Accounts: Images in an ACR instance under a different account.
Custom Image: Images not hosted in ACR.
Reference Image from Other Task Template: Reuse the image from an existing task template.
Deploy by Code Package: Click Set Code Package Deployment. Select a Technology Stack Language and Code Package Type, upload your code package, and specify the runtime environment. See Deploy an application using a code package.
Shell Script: Click Configure Shell Script and write your task execution script. Refer to the example script on the page.
Parameter Description Task Template Name Enter a name for the task template. Namespace Type Select System-created or Select Existing Namespace. Task Deployment Method See Deployment methods below. Instance Type See Instance types below. Single Instance Specification Specify the CPU and memory for each instance. Concurrent Instances Specify the number of instances to run at the same time. Instance type Performance Preemption risk Best for Default Stable None High real-time performance and stability requirements BestEffort May fluctuate significantly Can be preempted and evicted No strict real-time or stability requirements BestEffort Preferred Prioritizes BestEffort; falls back to Default if preempted Auto-fallback prevents task interruption Cost savings with resilience On the Task Settings page, configure the following parameters and click Next. Task type Additional settings (expand More Settings)
Periodic Task: Runs automatically on a cron schedule.
In the Cron Expression field, enter a cron expression or click Use Generation Tool to build one interactively. The cron expression uses this format:
# ┌─────────── minute (0–59) # │ ┌─────────── hour (0–23) # │ │ ┌─────────── day of the month (1–31) # │ │ │ ┌─────────── month (1–12) # │ │ │ │ ┌─────────── day of the week (0–6, Sunday to Saturday) # │ │ │ │ │ # * * * * *Common cron operators:
Operator Description Example *Any value 0 * * * *— runs every hour,List separator 0 9,17 * * *— runs at 9 AM and 5 PM-Range 0 9 * * 1-5— runs at 9 AM, Monday through Friday/Step */15 * * * *— runs every 15 minutesOne-time Task (Triggered by HTTP/HTTPS): Runs when it receives an HTTP or HTTPS request.
Parameter Description Request Type Select the protocol to accept: HTTP, HTTPS, or HTTP&HTTPS. Request Method Select one or more HTTP methods to accept: GET, POST, PUT, PATCH, DELETE, or HEAD. Security Configuration Controls which requests trigger a task. Options: No Configuration Required (all requests are accepted), Secure Domain Name (requests from a specific domain only), or IP CIDR block (requests from a specific IP address or CIDR range only).
Parameter Default Range Description Concurrency Policy Allow — Controls what happens when a new task is triggered before the previous one finishes. Allow (default): run concurrently; scheduled tasks continuously create new tasks. Forbid: a new task is not created if the previous one has not finished. Replace: stop the previous task and start the new one. Timeout 3600 s 0–604800 s Maximum duration for a task. The system tries to stop the task if it exceeds this limit. Retries 3 0–10 Number of retry attempts after a task fails. Enable Task Sharding Off — Distribute a task across multiple clients for parallel execution. Used for big data processing. Toggle the switch and click Edit Task Shard Name to configure shard names. (Optional) On the Advanced Settings page, configure additional runtime options.
Click Create and wait for the task template to be created.
To view the template, go to the SAE Task Templates page, select a region and a namespace, and click the template name to open its details page.
Run and stop tasks
Run a periodic task
Periodic tasks run automatically based on the cron expression in the task template. No manual action is required.
Trigger a one-time task via HTTP/HTTPS
On the SAE Task Templates page, select a region and a namespace, and click the target task template.
In the Job Settings section, copy the Public Request URL (for requests from the public network) or the Private Request URL.
Send a request to the URL. To pass parameters, use a POST request with a JSON body. Pass environment variables:
curl -d '{"Envs":[{"name":"aaa","value":"bbb"},{"name":"ccc","value":"ddd"}]}' \ -H 'Content-Type: application/json' \ <url> # Replace <url> with the actual Public or Private Request URL.Override the number of concurrent instances:
curl -d '{"Replicas":"3"}' \ -H 'Content-Type: application/json' \ <url> # Replace <url> with the actual Public or Private Request URL.For all supported parameters, see ExecJob.
Manually trigger a task
Go to the task template details page.
Click Manually Execute Task in the upper-right corner.
Stop a task
Go to the task template details page.
Click Stop Task in the upper-right corner and follow the on-screen instructions.
Manage task records
Go to the task template details page.
In the left navigation pane, click Task Records.
On the Task Records page:
To view instance-level details, click a task ID to open the Task Record Details page.
To delete a task record, click Delete in the Actions column and follow the on-screen instructions.
View task events
Go to the task template details page.
In the left navigation pane, click Event Information.
Use the search box to filter events by Source Name, Event Reason, Source Type, or Event Level.
Edit or delete a task template
Go to the task template details page.
In the upper-right corner, click Edit Task Template or Delete Task Template and follow the on-screen instructions.
Deleting a task template permanently removes all associated task instances and template configuration. Any SLS resources provisioned for log collection are also released, and log collection is disabled.
Roll back to a previous version
If a template update causes issues, roll back to an earlier version:
Go to the task template details page.
Click Roll Back to Previous Version in the upper-right corner.
On the Roll Back to Previous Version page, select the target version and click OK.