Skip to main content

TriggerKind

Enum TriggerKind 

Source
pub enum TriggerKind {
    Manual,
    Webhook {
        path: String,
    },
    Cron {
        schedule: String,
        schedule_id: Option<Uuid>,
        scheduled_for: Option<DateTime<Utc>>,
    },
    Api,
    Retry {
        parent_run_id: Uuid,
    },
    Replay {
        original_run_id: Uuid,
    },
    Workflow,
    Nats {
        subject: String,
    },
    RunEvent {
        event_kind: String,
        source_run_id: Uuid,
    },
    Polling {
        probe: String,
    },
}
Expand description

How a run was triggered.

§Examples

use ironflow_store::entities::TriggerKind;

let trigger = TriggerKind::Manual;
let json = serde_json::to_string(&trigger).unwrap();
assert!(json.contains("manual"));
JSON schema
{
 "description": "How a run was triggered.\n\n# Examples\n\n```\nuse ironflow_store::entities::TriggerKind;\n\nlet trigger = TriggerKind::Manual;\nlet json = serde_json::to_string(&trigger).unwrap();\nassert!(json.contains(\"manual\"));\n```",
 "oneOf": [
   {
     "description": "Triggered manually (CLI or programmatic call).",
     "type": "object",
     "required": [
       "kind"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "manual"
         ]
       }
     }
   },
   {
     "description": "Triggered by an incoming webhook.",
     "type": "object",
     "required": [
       "kind",
       "path"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "webhook"
         ]
       },
       "path": {
         "description": "The webhook path that received the request.",
         "type": "string"
       }
     }
   },
   {
     "description": "Triggered by a cron schedule.",
     "type": "object",
     "required": [
       "kind",
       "schedule"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "cron"
         ]
       },
       "schedule": {
         "description": "The cron expression that fired.",
         "type": "string"
       },
       "schedule_id": {
         "description": "Schedule that created the run. `None` on runs created before it\nwas recorded.",
         "type": [
           "string",
           "null"
         ],
         "format": "uuid"
       },
       "scheduled_for": {
         "description": "Occurrence the run covers. `None` for a manual trigger of the\nschedule and on older runs.",
         "type": [
           "string",
           "null"
         ],
         "format": "date-time"
       }
     }
   },
   {
     "description": "Triggered via the REST API.",
     "type": "object",
     "required": [
       "kind"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "api"
         ]
       }
     }
   },
   {
     "description": "Retry of a previously failed run.",
     "type": "object",
     "required": [
       "kind",
       "parent_run_id"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "retry"
         ]
       },
       "parent_run_id": {
         "description": "The original run that failed.",
         "type": "string",
         "format": "uuid"
       }
     }
   },
   {
     "description": "Replay of a previously finished run on the current handler version.",
     "type": "object",
     "required": [
       "kind",
       "original_run_id"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "replay"
         ]
       },
       "original_run_id": {
         "description": "The original run that was replayed.",
         "type": "string",
         "format": "uuid"
       }
     }
   },
   {
     "description": "Triggered by a parent workflow as a sub-workflow step.",
     "type": "object",
     "required": [
       "kind"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "workflow"
         ]
       }
     }
   },
   {
     "description": "Triggered by a message consumed from a NATS subject.",
     "type": "object",
     "required": [
       "kind",
       "subject"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "nats"
         ]
       },
       "subject": {
         "description": "The NATS subject the message was consumed from.",
         "type": "string"
       }
     }
   },
   {
     "description": "Triggered by an internal run event (workflow chaining).",
     "type": "object",
     "required": [
       "event_kind",
       "kind",
       "source_run_id"
     ],
     "properties": {
       "event_kind": {
         "description": "The event kind that fired (e.g. `\"run_failed\"`).",
         "type": "string"
       },
       "kind": {
         "type": "string",
         "enum": [
           "run_event"
         ]
       },
       "source_run_id": {
         "description": "The run whose event triggered this run.",
         "type": "string",
         "format": "uuid"
       }
     }
   },
   {
     "description": "Triggered by a polling probe detecting new data.",
     "type": "object",
     "required": [
       "kind",
       "probe"
     ],
     "properties": {
       "kind": {
         "type": "string",
         "enum": [
           "polling"
         ]
       },
       "probe": {
         "description": "Name of the probe that fired (e.g. `\"http\"`, `\"sql\"`).",
         "type": "string"
       }
     }
   }
 ]
}
```ignore
</details>

Variants§

§

Manual

§

Webhook

Triggered by an incoming webhook.

Fields

§path: String

The webhook path that received the request.

§

Cron

Triggered by a cron schedule.

Fields

§schedule: String

The cron expression that fired.

§schedule_id: Option<Uuid>

Schedule that created the run. None on runs created before it was recorded.

§scheduled_for: Option<DateTime<Utc>>

Occurrence the run covers. None for a manual trigger of the schedule and on older runs.

§

Api

§

Retry

Retry of a previously failed run.

Fields

§parent_run_id: Uuid

The original run that failed.

§

Replay

Replay of a previously finished run on the current handler version.

Fields

§original_run_id: Uuid

The original run that was replayed.

§

Workflow

§

Nats

Triggered by a message consumed from a NATS subject.

Fields

§subject: String

The NATS subject the message was consumed from.

§

RunEvent

Triggered by an internal run event (workflow chaining).

Fields

§event_kind: String

The event kind that fired (e.g. "run_failed").

§source_run_id: Uuid

The run whose event triggered this run.

§

Polling

Triggered by a polling probe detecting new data.

Fields

§probe: String

Name of the probe that fired (e.g. "http", "sql").

Trait Implementations§

Source§

impl Clone for TriggerKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TriggerKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TriggerKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TriggerKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more