vapi_client/models/
workflow.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Workflow {
16    #[serde(rename = "nodes")]
17    pub nodes: Vec<models::WorkflowUserEditableNodesInner>,
18    #[serde(rename = "transcriber", skip_serializing_if = "Option::is_none")]
19    pub transcriber: Option<models::WorkflowUserEditableTranscriber>,
20    #[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
21    pub voice: Option<models::WorkflowUserEditableVoice>,
22    /// This is the plan for observability of workflow's calls.  Currently, only Langfuse is supported.
23    #[serde(rename = "observabilityPlan", skip_serializing_if = "Option::is_none")]
24    pub observability_plan: Option<models::LangfuseObservabilityPlan>,
25    /// These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.
26    #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")]
27    pub credentials: Option<Vec<models::WorkflowUserEditableCredentialsInner>>,
28    #[serde(rename = "id")]
29    pub id: String,
30    #[serde(rename = "orgId")]
31    pub org_id: String,
32    #[serde(rename = "createdAt")]
33    pub created_at: String,
34    #[serde(rename = "updatedAt")]
35    pub updated_at: String,
36    #[serde(rename = "name")]
37    pub name: String,
38    #[serde(rename = "edges")]
39    pub edges: Vec<models::Edge>,
40    #[serde(rename = "globalPrompt", skip_serializing_if = "Option::is_none")]
41    pub global_prompt: Option<String>,
42    /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.  The order of precedence is:  1. tool.server 2. workflow.server / assistant.server 3. phoneNumber.server 4. org.server
43    #[serde(rename = "server", skip_serializing_if = "Option::is_none")]
44    pub server: Option<models::Server>,
45    /// This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.
46    #[serde(rename = "compliancePlan", skip_serializing_if = "Option::is_none")]
47    pub compliance_plan: Option<models::CompliancePlan>,
48    /// This is the plan for analysis of workflow's calls. Stored in `call.analysis`.
49    #[serde(rename = "analysisPlan", skip_serializing_if = "Option::is_none")]
50    pub analysis_plan: Option<models::AnalysisPlan>,
51    /// This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.
52    #[serde(rename = "artifactPlan", skip_serializing_if = "Option::is_none")]
53    pub artifact_plan: Option<models::ArtifactPlan>,
54    /// This is the plan for when the workflow nodes should start talking.  You should configure this if you're running into these issues: - The assistant is too slow to start talking after the customer is done speaking. - The assistant is too fast to start talking after the customer is done speaking. - The assistant is so fast that it's actually interrupting the customer.
55    #[serde(rename = "startSpeakingPlan", skip_serializing_if = "Option::is_none")]
56    pub start_speaking_plan: Option<models::StartSpeakingPlan>,
57    /// This is the plan for when workflow nodes should stop talking on customer interruption.  You should configure this if you're running into these issues: - The assistant is too slow to recognize customer's interruption. - The assistant is too fast to recognize customer's interruption. - The assistant is getting interrupted by phrases that are just acknowledgments. - The assistant is getting interrupted by background noises. - The assistant is not properly stopping -- it starts talking right after getting interrupted.
58    #[serde(rename = "stopSpeakingPlan", skip_serializing_if = "Option::is_none")]
59    pub stop_speaking_plan: Option<models::StopSpeakingPlan>,
60    /// This is the plan for real-time monitoring of the workflow's calls.  Usage: - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.
61    #[serde(rename = "monitorPlan", skip_serializing_if = "Option::is_none")]
62    pub monitor_plan: Option<models::MonitorPlan>,
63    /// This enables filtering of noise and background speech while the user is talking.  Features: - Smart denoising using Krisp - Fourier denoising  Both can be used together. Order of precedence: - Smart denoising - Fourier denoising
64    #[serde(
65        rename = "backgroundSpeechDenoisingPlan",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub background_speech_denoising_plan: Option<models::BackgroundSpeechDenoisingPlan>,
69    /// These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.
70    #[serde(rename = "credentialIds", skip_serializing_if = "Option::is_none")]
71    pub credential_ids: Option<Vec<String>>,
72}
73
74impl Workflow {
75    pub fn new(
76        nodes: Vec<models::WorkflowUserEditableNodesInner>,
77        id: String,
78        org_id: String,
79        created_at: String,
80        updated_at: String,
81        name: String,
82        edges: Vec<models::Edge>,
83    ) -> Workflow {
84        Workflow {
85            nodes,
86            transcriber: None,
87            voice: None,
88            observability_plan: None,
89            credentials: None,
90            id,
91            org_id,
92            created_at,
93            updated_at,
94            name,
95            edges,
96            global_prompt: None,
97            server: None,
98            compliance_plan: None,
99            analysis_plan: None,
100            artifact_plan: None,
101            start_speaking_plan: None,
102            stop_speaking_plan: None,
103            monitor_plan: None,
104            background_speech_denoising_plan: None,
105            credential_ids: None,
106        }
107    }
108}