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.599.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    /// Maximum number of concurrent executions of this flow
28    #[serde(rename = "concurrent_limit", skip_serializing_if = "Option::is_none")]
29    pub concurrent_limit: Option<f64>,
30    /// Expression to group concurrent executions (e.g., by user ID)
31    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
32    pub concurrency_key: Option<String>,
33    /// Time window in seconds for concurrent_limit
34    #[serde(rename = "concurrency_time_window_s", skip_serializing_if = "Option::is_none")]
35    pub concurrency_time_window_s: Option<f64>,
36    /// Delay in seconds to debounce flow executions
37    #[serde(rename = "debounce_delay_s", skip_serializing_if = "Option::is_none")]
38    pub debounce_delay_s: Option<f64>,
39    /// Expression to group debounced executions
40    #[serde(rename = "debounce_key", skip_serializing_if = "Option::is_none")]
41    pub debounce_key: Option<String>,
42    /// Arguments to accumulate across debounced executions
43    #[serde(rename = "debounce_args_to_accumulate", skip_serializing_if = "Option::is_none")]
44    pub debounce_args_to_accumulate: Option<Vec<String>>,
45    /// Maximum total time in seconds that a job can be debounced
46    #[serde(rename = "max_total_debouncing_time", skip_serializing_if = "Option::is_none")]
47    pub max_total_debouncing_time: Option<f64>,
48    /// Maximum number of times a job can be debounced
49    #[serde(rename = "max_total_debounces_amount", skip_serializing_if = "Option::is_none")]
50    pub max_total_debounces_amount: Option<f64>,
51    /// JavaScript expression to conditionally skip the entire flow
52    #[serde(rename = "skip_expr", skip_serializing_if = "Option::is_none")]
53    pub skip_expr: Option<String>,
54    /// Cache duration in seconds for flow results
55    #[serde(rename = "cache_ttl", skip_serializing_if = "Option::is_none")]
56    pub cache_ttl: Option<f64>,
57    #[serde(rename = "cache_ignore_s3_path", skip_serializing_if = "Option::is_none")]
58    pub cache_ignore_s3_path: Option<bool>,
59    /// Environment variables available to all steps
60    #[serde(rename = "flow_env", skip_serializing_if = "Option::is_none")]
61    pub flow_env: Option<std::collections::HashMap<String, String>>,
62    /// Execution priority (higher numbers run first)
63    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
64    pub priority: Option<f64>,
65    /// JavaScript expression to return early from the flow
66    #[serde(rename = "early_return", skip_serializing_if = "Option::is_none")]
67    pub early_return: Option<String>,
68    /// Whether this flow accepts chat-style input
69    #[serde(rename = "chat_input_enabled", skip_serializing_if = "Option::is_none")]
70    pub chat_input_enabled: Option<bool>,
71    /// Sticky notes attached to the flow
72    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
73    pub notes: Option<Vec<models::FlowNote>>,
74}
75
76impl FlowValue {
77    /// The flow structure containing modules and optional preprocessor/failure handlers
78    pub fn new(modules: Vec<models::FlowModule>) -> FlowValue {
79        FlowValue {
80            modules,
81            failure_module: None,
82            preprocessor_module: None,
83            same_worker: None,
84            concurrent_limit: None,
85            concurrency_key: None,
86            concurrency_time_window_s: None,
87            debounce_delay_s: None,
88            debounce_key: None,
89            debounce_args_to_accumulate: None,
90            max_total_debouncing_time: None,
91            max_total_debounces_amount: None,
92            skip_expr: None,
93            cache_ttl: None,
94            cache_ignore_s3_path: None,
95            flow_env: None,
96            priority: None,
97            early_return: None,
98            chat_input_enabled: None,
99            notes: None,
100        }
101    }
102}
103