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.
Cron
Triggered by a cron schedule.
Fields
Api
Retry
Retry of a previously failed run.
Replay
Replay of a previously finished run on the current handler version.
Workflow
Nats
Triggered by a message consumed from a NATS subject.
RunEvent
Triggered by an internal run event (workflow chaining).
Fields
Polling
Triggered by a polling probe detecting new data.
Trait Implementations§
Source§impl Clone for TriggerKind
impl Clone for TriggerKind
Source§impl Debug for TriggerKind
impl Debug for TriggerKind
Source§impl<'de> Deserialize<'de> for TriggerKind
impl<'de> Deserialize<'de> for TriggerKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TriggerKind
impl RefUnwindSafe for TriggerKind
impl Send for TriggerKind
impl Sync for TriggerKind
impl Unpin for TriggerKind
impl UnsafeUnpin for TriggerKind
impl UnwindSafe for TriggerKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more