Skip to main content
You can programmatically execute and manage batch jobs using the Blaxel API and Python SDK. Both synchronous and asynchronous usage is supported: use method_name for synchronous operations and amethod_name() for asynchronous operations.
The code examples in this section assume that your batch job has already been successfully deployed on Blaxel.

Dispatch job execution

Dispatch a job and wait for execution to start:
Time units in the Python SDK are specified in seconds.

Dispatch job execution with tasks

Dispatch a new job with tasks:

Get execution details

Get full execution details:

Get status

The possible job states are:
Get only the job status (faster than retrieving full execution details):

List executions

List all executions for a job:

Wait for completion

Poll until execution completes:
When polling:
  • adjust the interval based on the expected task duration
  • set the max_wait timeout longer than the expected total task duration

Override environment and memory for a single job execution

Override memory and/or environment variables for a single job execution, without modifying the deployed job configuration:
  • Memory overrides are expressed in MB and are downward-only: the value must be <= the memory configured at deployment time. For example, if the job is deployed with 4096 MB, execution overrides must be <= 4096 MB.
  • env supports multiple environment variables
  • memory and env can be set independently or together
  • Overrides apply only to the current execution

Complete example

Here is a complete example using synchronous operations:
Here is a complete example using asynchronous operations:

Deploy a job

Learn how to deploy your AI batch jobs on Blaxel as a serverless auto-scalable endpoint.
Last modified on May 14, 2026