Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.anthropic.triggers.batch

Classes

AnthropicBatchTrigger

Poll an Anthropic Message Batch until it reaches the terminal ended status.

Module Contents

class airflow.providers.anthropic.triggers.batch.AnthropicBatchTrigger(conn_id, batch_id, poll_interval, end_time)[source]

Bases: airflow.triggers.base.BaseTrigger

Poll an Anthropic Message Batch until it reaches the terminal ended status.

Parameters:
  • conn_id (str) – The Anthropic connection ID.

  • batch_id (str) – The batch to poll.

  • poll_interval (float) – Seconds to sleep between polls.

  • end_time (float) – Wall-clock deadline (time.time() epoch seconds) after which a timeout event is emitted. Wall-clock is used deliberately: the trigger is serialized to the metadata DB and may resume in a different triggerer process, so a per-process time.monotonic() value would not survive serialization.

conn_id[source]
batch_id[source]
poll_interval[source]
end_time[source]
serialize()[source]

Serialize AnthropicBatchTrigger arguments and class path.

async on_kill()[source]

Cancel the batch when a user kills the deferred task.

Runs in the triggerer event loop on Airflow 3.3+ (a no-op override on older versions, which never call it). Closes the gap the operator’s on_kill leaves for deferred tasks, which have released their worker slot.

async run()[source]

Poll the batch status and yield exactly one terminal event.

Was this entry helpful?