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.592.1
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    /// JavaScript expression to conditionally skip the entire flow
43    #[serde(rename = "skip_expr", skip_serializing_if = "Option::is_none")]
44    pub skip_expr: Option<String>,
45    /// Cache duration in seconds for flow results
46    #[serde(rename = "cache_ttl", skip_serializing_if = "Option::is_none")]
47    pub cache_ttl: Option<f64>,
48    #[serde(rename = "cache_ignore_s3_path", skip_serializing_if = "Option::is_none")]
49    pub cache_ignore_s3_path: Option<bool>,
50    /// Environment variables available to all steps
51    #[serde(rename = "flow_env", skip_serializing_if = "Option::is_none")]
52    pub flow_env: Option<std::collections::HashMap<String, String>>,
53    /// Execution priority (higher numbers run first)
54    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
55    pub priority: Option<f64>,
56    /// JavaScript expression to return early from the flow
57    #[serde(rename = "early_return", skip_serializing_if = "Option::is_none")]
58    pub early_return: Option<String>,
59    /// Whether this flow accepts chat-style input
60    #[serde(rename = "chat_input_enabled", skip_serializing_if = "Option::is_none")]
61    pub chat_input_enabled: Option<bool>,
62    /// Sticky notes attached to the flow
63    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
64    pub notes: Option<Vec<models::FlowNote>>,
65}
66
67impl FlowValue {
68    /// The flow structure containing modules and optional preprocessor/failure handlers
69    pub fn new(modules: Vec<models::FlowModule>) -> FlowValue {
70        FlowValue {
71            modules,
72            failure_module: None,
73            preprocessor_module: None,
74            same_worker: None,
75            concurrent_limit: None,
76            concurrency_key: None,
77            concurrency_time_window_s: None,
78            debounce_delay_s: None,
79            debounce_key: None,
80            skip_expr: None,
81            cache_ttl: None,
82            cache_ignore_s3_path: None,
83            flow_env: None,
84            priority: None,
85            early_return: None,
86            chat_input_enabled: None,
87            notes: None,
88        }
89    }
90}
91