Skip to main content

windmill_api/models/
flow_value.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.862.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// FlowValue : The flow structure containing modules and optional preprocessor/failure handlers
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FlowValue {
17    /// Array of steps that execute in sequence. Each step can be a script, subflow, loop, or branch
18    #[serde(rename = "modules")]
19    pub modules: Vec<models::FlowModule>,
20    #[serde(rename = "failure_module", skip_serializing_if = "Option::is_none")]
21    pub failure_module: Option<Box<models::FlowModule>>,
22    #[serde(rename = "preprocessor_module", skip_serializing_if = "Option::is_none")]
23    pub preprocessor_module: Option<Box<models::FlowModule>>,
24    /// If true, all steps run on the same worker for better performance
25    #[serde(rename = "same_worker", skip_serializing_if = "Option::is_none")]
26    pub same_worker: Option<bool>,
27    /// If true and the flow runs on a custom worker tag, steps that declare their own non-empty tag run on it instead of inheriting the flow tag. Steps without their own tag still inherit the flow tag.
28    #[serde(rename = "preserve_step_tags", skip_serializing_if = "Option::is_none")]
29    pub preserve_step_tags: Option<bool>,
30    /// Maximum number of concurrent executions of this flow
31    #[serde(rename = "concurrent_limit", skip_serializing_if = "Option::is_none")]
32    pub concurrent_limit: Option<f64>,
33    /// Expression to group concurrent executions (e.g., by user ID)
34    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
35    pub concurrency_key: Option<String>,
36    /// Time window in seconds for concurrent_limit
37    #[serde(rename = "concurrency_time_window_s", skip_serializing_if = "Option::is_none")]
38    pub concurrency_time_window_s: Option<f64>,
39    /// Delay in seconds to debounce flow executions
40    #[serde(rename = "debounce_delay_s", skip_serializing_if = "Option::is_none")]
41    pub debounce_delay_s: Option<i32>,
42    /// Expression to group debounced executions
43    #[serde(rename = "debounce_key", skip_serializing_if = "Option::is_none")]
44    pub debounce_key: Option<String>,
45    /// Arguments to accumulate across debounced executions
46    #[serde(rename = "debounce_args_to_accumulate", skip_serializing_if = "Option::is_none")]
47    pub debounce_args_to_accumulate: Option<Vec<String>>,
48    /// Maximum total time in seconds that a job can be debounced
49    #[serde(rename = "max_total_debouncing_time", skip_serializing_if = "Option::is_none")]
50    pub max_total_debouncing_time: Option<i32>,
51    /// Maximum number of times a job can be debounced
52    #[serde(rename = "max_total_debounces_amount", skip_serializing_if = "Option::is_none")]
53    pub max_total_debounces_amount: Option<i32>,
54    /// JavaScript expression to conditionally skip the entire flow
55    #[serde(rename = "skip_expr", skip_serializing_if = "Option::is_none")]
56    pub skip_expr: Option<String>,
57    /// Cache duration in seconds for flow results
58    #[serde(rename = "cache_ttl", skip_serializing_if = "Option::is_none")]
59    pub cache_ttl: Option<f64>,
60    #[serde(rename = "cache_ignore_s3_path", skip_serializing_if = "Option::is_none")]
61    pub cache_ignore_s3_path: Option<bool>,
62    /// If set, delete the flow job's args, result and logs after this many seconds following job completion
63    #[serde(rename = "delete_after_secs", skip_serializing_if = "Option::is_none")]
64    pub delete_after_secs: Option<i32>,
65    /// Wall-clock limit in seconds for the whole flow run, counted from its start and including time spent sleeping or suspended at an approval. It also applies when the flow is called as a subflow step, unless that step sets its own timeout, which replaces it. It is checked periodically, so a run can go a few seconds past it. When it expires, the running steps are cancelled, the failure module runs if there is one, and the flow ends cancelled with a timeout error. A calling flow sees the subflow step fail with that error.
66    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
67    pub timeout: Option<i32>,
68    /// Environment variables available to all steps. Values can be strings, JSON values, or special references: '$var:path' (workspace variable) or '$res:path' (resource).
69    #[serde(rename = "flow_env", skip_serializing_if = "Option::is_none")]
70    pub flow_env: Option<std::collections::HashMap<String, serde_json::Value>>,
71    /// Execution priority (higher numbers run first)
72    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
73    pub priority: Option<f64>,
74    /// Id of the step whose result a sync webhook returns as soon as that step completes, while the rest of the flow keeps running. When the step does not run, or fails while the flow has a failure module, the flow's final result is returned instead.
75    #[serde(rename = "early_return", skip_serializing_if = "Option::is_none")]
76    pub early_return: Option<String>,
77    /// Whether this flow accepts chat-style input
78    #[serde(rename = "chat_input_enabled", skip_serializing_if = "Option::is_none")]
79    pub chat_input_enabled: Option<bool>,
80    /// Sticky notes attached to the flow
81    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
82    pub notes: Option<Vec<models::FlowNote>>,
83    /// Semantic groups of modules for organizational purposes
84    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
85    pub groups: Option<Vec<models::FlowGroup>>,
86}
87
88impl FlowValue {
89    /// The flow structure containing modules and optional preprocessor/failure handlers
90    pub fn new(modules: Vec<models::FlowModule>) -> FlowValue {
91        FlowValue {
92            modules,
93            failure_module: None,
94            preprocessor_module: None,
95            same_worker: None,
96            preserve_step_tags: None,
97            concurrent_limit: None,
98            concurrency_key: None,
99            concurrency_time_window_s: None,
100            debounce_delay_s: None,
101            debounce_key: None,
102            debounce_args_to_accumulate: None,
103            max_total_debouncing_time: None,
104            max_total_debounces_amount: None,
105            skip_expr: None,
106            cache_ttl: None,
107            cache_ignore_s3_path: None,
108            delete_after_secs: None,
109            timeout: None,
110            flow_env: None,
111            priority: None,
112            early_return: None,
113            chat_input_enabled: None,
114            notes: None,
115            groups: None,
116        }
117    }
118}
119