Skip to main content
Workflows scale out automatically as their endpoints are called. When you invoke a workflow, Tensorlake spins up containers for each function as needed, processes the request, and scales back down when idle. Each function in your workflow can have its own scaling configuration. You control scaling behavior with two parameters: warm_containers and max_containers. Example workflow with scaling:
When you call POST /applications/process_workflow, the workflow endpoint scales automatically, and each function scales based on its configuration.

Scaling Parameters

Configure scaling in the @function() decorator:

warm_containers

Number of pre-warmed containers to keep ready. Warm containers have your code and dependencies loaded, eliminating cold start latency for incoming requests.
Use warm containers when:
  • You need low-latency responses
  • Cold starts are unacceptable for your use case
  • You have predictable baseline traffic

max_containers

Maximum number of containers. Once this limit is reached, additional requests are automatically queued and processed in FIFO order as containers become available.

Automatic Queuing

When all containers for a function are busy and max_containers has been reached, Tensorlake automatically queues incoming requests. No configuration is needed — queuing is built into the platform.
  • Requests are processed in FIFO order
  • Queued requests begin processing as soon as a container becomes available
  • No separate queue infrastructure (Redis, SQS, RabbitMQ) is required

Combined Behaviors

Combine parameters for fine-grained control:

Low-latency with bounded scale

High-throughput with bounded cost

Scaling in Workflows

Each function in your workflow scales independently. This allows different workflow steps to have different scaling profiles based on their resource requirements and latency needs:
In this workflow, fetch_data can scale to 50 containers for high throughput, while analyze_with_llm is capped at 3 to control costs. When you call the process_record endpoint, both functions scale independently based on their configuration.

Default Behavior

Without any scaling parameters, workflow functions scale dynamically:
  • Containers scale from zero based on demand when the workflow endpoint is called
  • There is no upper bound on container count
  • Cold starts occur for the first request after an idle period
  • No automatic queuing (unlimited scaling)

Learn More

SDK Reference

Full @function() decorator reference.

Agentic Patterns

Structuring agents for scale.

Building Workflows

Multi-step data workflows.