job_decorator

Decorator for marking worker methods as job handlers.

pipecat.pipeline.job_decorator.job(*, name: str, sequential: bool = False)[source]

Mark a worker method as a job handler.

Decorated methods are automatically collected by BaseWorker at initialization and dispatched when matching job requests arrive. Each request runs in its own asyncio task so the bus message loop is never blocked.

Example:

@job(name="research")
async def on_research(self, message):
    ...

@job(name="write", sequential=True)
async def on_write(self, message):
    ...
Parameters:
  • name – Job name to match. The handler only receives requests with a matching name.

  • sequential – When True, requests with this name run one at a time in FIFO order. Concurrent requests wait for the previous one to finish before running. When False (the default), multiple requests run concurrently. The wait time counts against the requester’s timeout, so a slow predecessor can cause queued requests to time out before they start.