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 TypeScript SDK are specified in milliseconds.
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:List executions
List all executions for a job:Wait for completion
Poll until execution completes: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.
envsupports multiple environment variablesmemoryandenvcan be set independently or together- Overrides apply only to the current execution
Reject immediately when capacity is unavailable
By default, when your workspace is at its capacity limit, a new execution is accepted, queued, and retried in the background until capacity frees up. SetallowQueue: false to instead check capacity synchronously at creation time and get an immediate error if the execution cannot start right now:
allowQueueomitted ortrue: the execution is queued and retried in the background (default behavior)allowQueue: false: the request returns a 429 error if capacity is unavailable right now, or a 400 error if the request can never fit within the workspace quota- On rejection, no execution is created and nothing is queued, so there is nothing to poll or clean up
Complete example
Here is a complete example:Deploy a job
Learn how to deploy your AI batch jobs on Blaxel as a serverless auto-scalable endpoint.
