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.717.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    /// Environment variables available to all steps. Values can be strings, JSON values, or special references: '$var:path' (workspace variable) or '$res:path' (resource).
66    #[serde(rename = "flow_env", skip_serializing_if = "Option::is_none")]
67    pub flow_env: Option<std::collections::HashMap<String, serde_json::Value>>,
68    /// Execution priority (higher numbers run first)
69    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
70    pub priority: Option<f64>,
71    /// JavaScript expression to return early from the flow
72    #[serde(rename = "early_return", skip_serializing_if = "Option::is_none")]
73    pub early_return: Option<String>,
74    /// Whether this flow accepts chat-style input
75    #[serde(rename = "chat_input_enabled", skip_serializing_if = "Option::is_none")]
76    pub chat_input_enabled: Option<bool>,
77    /// Sticky notes attached to the flow
78    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
79    pub notes: Option<Vec<models::FlowNote>>,
80    /// Semantic groups of modules for organizational purposes
81    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
82    pub groups: Option<Vec<models::FlowGroup>>,
83}
84
85impl FlowValue {
86    /// The flow structure containing modules and optional preprocessor/failure handlers
87    pub fn new(modules: Vec<models::FlowModule>) -> FlowValue {
88        FlowValue {
89            modules,
90            failure_module: None,
91            preprocessor_module: None,
92            same_worker: None,
93            preserve_step_tags: None,
94            concurrent_limit: None,
95            concurrency_key: None,
96            concurrency_time_window_s: None,
97            debounce_delay_s: None,
98            debounce_key: None,
99            debounce_args_to_accumulate: None,
100            max_total_debouncing_time: None,
101            max_total_debounces_amount: None,
102            skip_expr: None,
103            cache_ttl: None,
104            cache_ignore_s3_path: None,
105            delete_after_secs: None,
106            flow_env: None,
107            priority: None,
108            early_return: None,
109            chat_input_enabled: None,
110            notes: None,
111            groups: None,
112        }
113    }
114}
115