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

airflow.providers.microsoft.winrm.triggers.winrm

Trigger for winrm remote execution.

Classes

WinRMCommandOutputTrigger

A trigger that polls the command output executed by the WinRMHook.

Module Contents

class airflow.providers.microsoft.winrm.triggers.winrm.WinRMCommandOutputTrigger(ssh_conn_id, shell_id, command_id, return_output=True, poll_interval=1, max_output_chunks=100)[source]

Bases: airflow.triggers.base.BaseTrigger

A trigger that polls the command output executed by the WinRMHook.

This trigger avoids blocking a worker when using the WinRMOperator in deferred mode.

The behavior of this trigger is as follows: - poll the command output from the shell launched by WinRM, - if command not done then sleep and retry, - when command done then return the output.

Parameters:
  • ssh_conn_id (str) – connection id from airflow Connections from where all the required parameters can be fetched like username and password, though priority is given to the params passed during init.

  • shell_id (str) – The shell id on the remote machine.

  • command_id (str) – The command id executed on the remote machine.

  • return_output (bool) – Whether to accumulate and return the stdout or not, defaults to True.

  • poll_interval (float) – How often, in seconds, the trigger should poll the output command of the launched command, defaults to 1.

  • max_output_chunks (int) – Maximum number of stdout/stderr chunks to keep in a rolling buffer to prevent excessive memory usage for long-running commands, defaults to 100.

ssh_conn_id[source]
shell_id[source]
command_id[source]
return_output = True[source]
poll_interval = 1[source]
serialize()[source]

Serialize WinRMCommandOutputTrigger arguments and classpath.

property hook: airflow.providers.microsoft.winrm.hooks.winrm.WinRMHook[source]
async get_command_output(conn)[source]
async run()[source]

Run the trigger in an asynchronous context.

The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.

If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).

In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.

Was this entry helpful?