from pipecat.pipeline.job_context import JobParams
Everything a job dispatch needs, in one object. Pass it as params= to job() or request_job().
Field
Type
Default
Description
name
str | None
None
Routes the request to the matching @job(name=...) handler on the worker
payload
dict | None
None
Structured data describing the work
timeout
float | None
None
Seconds, covering both the wait for the worker to become ready and the job itself
label
str | None
None
Human-readable description, e.g. "Research: Radiohead". A UIWorker titles the client’s progress card with it
cancellable
bool
True
Whether an external requester, such as the client UI, may ask for the job to be cancelled
from pipecat.pipeline.job_context import JobParamsasync with self.job("researcher", params=JobParams(payload={"topic": topic})) as j: passresult = j.response
cancellable governs requests from outside the worker. Cancellation the
worker initiates itself — on shutdown, on a timeout, or through
cancel_on_error — proceeds either way.
# Create from a dict (ignores unknown keys)args = WorkerActivationArgs.from_dict({"metadata": {...}})# Convert to a dict (excludes None values)data = args.to_dict()
from pipecat.pipeline.job_context import JobContext
Async context manager and iterator for a single-agent job. Sends a job request on enter, waits for the response on exit. Supports async for to receive intermediate events.On normal completion, the result is available via response. On worker error or timeout, raises JobError. If the worker isn’t ready within the timeout, entering the block raises JobGroupError instead.
from pipecat.pipeline.job_context import JobGroupContext
Async context manager and iterator for structured job group execution. Sends job requests on enter, waits for all responses on exit. Supports async for to receive intermediate events.On normal completion, results are available via responses. On worker error (with cancel_on_error=True) or timeout, raises JobGroupError.
async with self.job_group("w1", "w2", params=JobGroupParams(payload=data)) as jg: async for event in jg: print(f"{event.worker_name} [{event.type}]: {event.data}")for name, result in jg.responses.items(): print(name, result)