hymir.executors.celery module

class hymir.executors.celery.CeleryExecutor(*, queue: str | None = None, priority: int | None = None)

Bases: Executor

An executor that uses the celery task queue to run jobs in a workflow.

Note

You must ensure Celery has been configured to load the tasks from this file, or the tasks will not be available to the Celery worker. You can do this by adding the following to your Celery configuration:

celery_app.autodiscover_tasks(["hymir.executors.celery"])
Parameters:
  • queue – The name of the queue to use for the workflow’s main monitor task. [default: None]

  • priority – The priority of the workflow’s main monitor task. [default: None]

run(workflow: Workflow) str

Run a workflow and return a unique identifier which can be used to track the progress of the workflow.

Parameters:

workflow – The workflow to run.

Returns:

The unique identifier for the workflow.