Skip to content
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
287 commits
Select commit Hold shift + click to select a range
c9ae4f5
adjust logic in update handler
Aug 22, 2025
6ff24a9
add triggers to api v2
Aug 22, 2025
99e2ac7
remvoe unused file
Aug 22, 2025
87f8857
Merge branch 'main' of https://github.com/calcom/cal.com into devin/1…
Amit91848 Aug 26, 2025
d27e45f
rename to getAcitveOnOptions handler
Aug 26, 2025
59a4c9c
remove routingFormOptions handler
Aug 26, 2025
fdc18cb
clean up getActiveOnOptions
Aug 26, 2025
a9ab403
refactor WorkflowService
Amit91848 Aug 26, 2025
4874a6f
remove logs
Amit91848 Aug 26, 2025
24dd93f
remove unused
Amit91848 Aug 26, 2025
4429ced
Merge branch 'devin/1755107037-add-workflow-triggers' of https://gith…
Amit91848 Aug 26, 2025
3b5e530
fix: type check
Amit91848 Aug 26, 2025
c13dcbe
fix: missed before after events for recurring
Amit91848 Aug 26, 2025
e2768cc
fix: calendarEvent handleMarkNoShow
Amit91848 Aug 26, 2025
b957355
fix error message
Amit91848 Aug 26, 2025
3672d04
Merge branch 'main' into feat/routing-form-workflow-triggers
Aug 26, 2025
57a7d9b
don't query disabled routing forms
Aug 26, 2025
72422b0
merge devin/1755107037-add-workflow-triggers
Aug 27, 2025
a659afc
create tasker function
Aug 27, 2025
a35e1ec
add tasker code
Aug 28, 2025
1b9962f
move isFormTrigger function
Aug 28, 2025
6be759d
Merge branch 'main' into devin/1755107037-add-workflow-triggers
CarinaWolli Aug 28, 2025
4fdd9b6
Merge branch 'main' into feat/routing-form-workflow-triggers
Aug 28, 2025
9c6b365
small adjustments + todo comments
Aug 28, 2025
078df04
remove email to host action for form triggers
Aug 28, 2025
97c5572
throw trpc error if email to host is added as step
Aug 28, 2025
805f8be
Merge branch 'main' of https://github.com/calcom/cal.com into devin/1…
Amit91848 Aug 29, 2025
1ab36bd
fix dialog on how to use form responses as variables
Aug 29, 2025
ab1a14c
remove add variable dropdown for form triggers
Aug 29, 2025
200f3fa
remove form workfows in event workflows tab
Aug 29, 2025
239f3db
improvements for workflow logic on form submission
Aug 29, 2025
952cf34
review fixes
Amit91848 Aug 29, 2025
b57f4a4
base setup for seperate schedule functions (evt and form)
Aug 29, 2025
026762f
add missing BOOKING_PAID workflow trigger
Amit91848 Sep 1, 2025
737b643
fix pathname
Amit91848 Sep 1, 2025
19a9aaf
fix: test for BOOKING_REQUESTED
Amit91848 Sep 1, 2025
50a994c
fix activeOn ids
Sep 1, 2025
024c888
pass hideBranding and smsReminderNumber
Sep 1, 2025
42fe72c
adjustments to reminderScheduler
Sep 1, 2025
a702b71
create empty scheduelForForm functions
Sep 1, 2025
0dc6b08
pass locale and timezone with form user
Sep 1, 2025
672c1d7
pass formData instead of responses
Sep 1, 2025
bc4e630
pass timeFormat and locale
Sep 1, 2025
d7b0117
reusable function for email sending and reminder creation
Sep 2, 2025
e14adee
implement scheduleEmailReminderForForm
Sep 2, 2025
4d6356c
remove added editor field from merge conflict
Sep 2, 2025
1c03eed
don't support cal.ai action with form triggers
Sep 2, 2025
1603f44
throw bad request if form trigger and cal.ai is combined
Sep 2, 2025
8362a7f
add tests for scheduleFormWorkflows
Sep 2, 2025
c8ccd40
add form submission tests
Sep 2, 2025
f82dfd6
remove form response varibe info
Sep 3, 2025
3494c61
clean up workflow actions
Sep 3, 2025
557f0f4
fixes for getting template options
Sep 3, 2025
6b4aaf7
pass triggerType to getAllWorkflows
Sep 3, 2025
23751d0
move reusable logic to scheduleSMSReminder
Sep 3, 2025
e1a234f
add formdata to param type
Sep 3, 2025
a5c3be2
type fixes for text reminder managers
Sep 3, 2025
a69f86d
implement scheduleSMSReminderForForm
Sep 3, 2025
4e48e9c
fix import
Sep 3, 2025
4c65847
fix isAuthorizedToAddActiveOnIds
Sep 3, 2025
82e7d41
disble whatsapp action
Sep 3, 2025
cfe2068
implement triggerFormSubmittedNoEventWorkflow
Sep 3, 2025
6ba946b
code clean up
Sep 3, 2025
4c557e7
Merge branch 'devin/1755107037-add-workflow-triggers' into feat/routi…
Sep 3, 2025
fe627db
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 3, 2025
af86d6b
fix type errors
Sep 3, 2025
2931206
remove async from getSubmitterEmail
Sep 4, 2025
7e0e572
fix type errors
Sep 4, 2025
1d3f76f
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 4, 2025
0e38ce9
revert cal.ai changes
Sep 4, 2025
7451a79
fix type error
Sep 4, 2025
9303773
add sublogger
Sep 4, 2025
eac7306
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 4, 2025
91253e3
code clean up
Sep 4, 2025
43a788c
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 4, 2025
32de973
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 4, 2025
ddd343e
fix type errors
Sep 4, 2025
6b8e602
remove label for attendee whatsapp action
Sep 4, 2025
d20accd
merge main into feat/routing-form-workflow-triggers
Sep 4, 2025
3554cdd
code clean up
Sep 5, 2025
07a15f2
fixes saving teams on org workflows
Sep 5, 2025
25ff5a7
merge main
Sep 5, 2025
6801f3f
fix type error
Sep 5, 2025
0a3590a
code improvements for activeOn ids
Sep 5, 2025
b294e22
Revert "code improvements for activeOn ids"
Sep 5, 2025
520f3bc
improve variable name
Sep 5, 2025
2e115ea
fix unit tests
Sep 5, 2025
380f9fa
small fixes
Sep 5, 2025
d9ed5b3
type fixes
Sep 5, 2025
b159476
remove unused translation keys
Sep 7, 2025
b5b6878
Merge branch 'main' into feat/routing-form-workflow-triggers
Sep 8, 2025
6a90b6a
fix merge conflict issues
Sep 8, 2025
01ead92
code clean up
Sep 8, 2025
6eac654
remove SMS action support
Sep 8, 2025
2cc85dc
remove more SMS code
Sep 8, 2025
d551320
add missing imports
Sep 8, 2025
eadb532
set custom template for form action
Sep 8, 2025
d0ca589
type fixes
Sep 8, 2025
594e162
fix tasker endpoint
Sep 8, 2025
069ae98
fix duplicate check
Sep 8, 2025
fec95f3
merge main
Sep 8, 2025
8766ae4
fix workfows.test.ts
Sep 8, 2025
78ad4b1
use repository funciton to getHideBranding
Sep 8, 2025
3fb8560
add back SMS action
Sep 8, 2025
1bcf88f
add back changes to smsReminderManager
Sep 8, 2025
46e0c23
code clean up
Sep 8, 2025
25e05c0
fix hasDuplicateSubmission
Sep 8, 2025
ec9795e
code clean up
Sep 8, 2025
c6a7919
select only needed properties
Sep 8, 2025
7c77d9a
Merge branch 'main' into feat/routing-form-workflow-triggers
CarinaWolli Sep 8, 2025
7aa47b1
remove repository functions
Sep 8, 2025
46da699
Revert "remove repository functions"
Sep 8, 2025
fe5db4f
add scheduleWorkflows function
Sep 8, 2025
9ab0a5a
Revert "add scheduleWorkflows function"
Sep 8, 2025
91e0152
move type to /types
Sep 8, 2025
3b1533e
Revert "move type to /types"
Sep 8, 2025
f43e786
revert changes causing type errors
Sep 8, 2025
af9fab6
remove import
Sep 8, 2025
1916768
remove unused import
Sep 8, 2025
d437af5
Revert "remove unused import"
Sep 8, 2025
763023f
revert changed from attempt to fix type errors
Sep 8, 2025
a120784
pass object to gt all workflows
Sep 8, 2025
894dbb4
fix isAuthorized check
Sep 8, 2025
51db2d0
trigger filtering
Sep 8, 2025
cfe376b
remove form submitted no event booked code
Sep 9, 2025
c2a3bec
remove form submitted no event from schema
Sep 9, 2025
5de5144
remove more code
Sep 9, 2025
40774f8
remove test
Sep 9, 2025
2823164
fixes
Sep 9, 2025
86c04ee
add getSubmitterEmail function
Sep 9, 2025
1533478
add trigger
Sep 9, 2025
37eb400
small fixes
Sep 9, 2025
e81ead9
merge main
Sep 10, 2025
291bd8b
add missing workflow DTOs
Sep 10, 2025
fd7ba2b
small fixes
Sep 10, 2025
48b8d38
use activeOnWithChildren
Sep 10, 2025
fad1be8
Merge branch 'main' into feat/form-submitted-workflow-triggers
Sep 11, 2025
23539a0
fix active on when switching trigger type
Sep 11, 2025
6397b7f
git merge main
Sep 11, 2025
4145517
remove add variable dropdown
Sep 11, 2025
dcb425f
merge main
Sep 16, 2025
1177fda
add getAllWorkflowsFromRoutingForm to WorkflowService
Sep 16, 2025
dc68390
fix error caused by undefined evt
Sep 16, 2025
073ad7b
fix type error
Sep 16, 2025
78cc038
fix type error
Sep 17, 2025
d42f37b
fix tests
Sep 17, 2025
b3cb251
merge main
Sep 17, 2025
2d15556
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Sep 18, 2025
1196d46
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Sep 18, 2025
b891d17
Merge branch 'main' into feat/form-submitted-workflow-triggers
Udit-takkar Sep 19, 2025
f7d5e57
code clean up
Sep 19, 2025
ee597d7
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Sep 19, 2025
0810fb5
final fixes and clean up
Sep 19, 2025
ac0e4f4
remove console.log
Sep 19, 2025
b115131
remove template text form from triggers
Sep 19, 2025
eac95df
add routing form repoditory function
Sep 19, 2025
983b212
Merge branch 'feat/form-submitted-workflow-triggers' into feat/sms-ac…
Sep 22, 2025
1a2395f
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Sep 22, 2025
4354aea
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Sep 22, 2025
d4e8569
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Sep 22, 2025
acccf59
fix bug with key
Sep 22, 2025
4d59930
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Sep 22, 2025
6816f6b
Merge branch 'feat/form-submitted-workflow-triggers' into feat/sms-ac…
Sep 22, 2025
0dd6c0b
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Sep 22, 2025
415854b
add comments
Sep 22, 2025
f7b6b87
fix test
Sep 24, 2025
e98c87d
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Sep 24, 2025
7ca4ef5
add missing await
Sep 24, 2025
8cb0738
use predefined FormSubmissionData type
Sep 24, 2025
bf0fff1
add .trim() to sms message
Sep 24, 2025
9f5711e
pass contextData instead
Sep 24, 2025
0632559
Merge branch 'main' into feat/form-submitted-workflow-triggers
CarinaWolli Sep 24, 2025
99ad38f
Merge branch 'main' into feat/form-submitted-workflow-triggers
hbjORbj Sep 25, 2025
c1ecf8a
add missing trigger in update-workflow.input.ts
Sep 25, 2025
146cffc
Merge branch 'devin/1755107037-add-workflow-triggers' into feat/routi…
Sep 25, 2025
f4da96d
ForEvt and ForForm function for aiPhoneCallManager
Sep 2, 2025
6b82d21
chore: add support for form workflows on api v2
ThyMinimalDev Sep 25, 2025
c2c4a26
fixup! chore: add support for form workflows on api v2
ThyMinimalDev Sep 25, 2025
49a4587
Merge branch 'main' into feat/form-submitted-workflow-triggers
ThyMinimalDev Sep 25, 2025
6553d27
Merge branch 'main' into feat/form-submitted-workflow-triggers
CarinaWolli Sep 26, 2025
18bf4d8
use only repository functions in update handler
Sep 29, 2025
fb9c6e9
move all prisma queries from list.handler
Sep 29, 2025
b1a872b
review suggestions
Sep 29, 2025
c8c236c
chore: handle workflows api v2
ThyMinimalDev Sep 30, 2025
7733682
chore: handle workflows api v2, split in 2 endpoints
ThyMinimalDev Sep 30, 2025
d08297e
fix workflow step creation
Sep 30, 2025
f039e5c
remove connect agent and fixes types
Sep 30, 2025
97c8785
add type to workflow
Sep 30, 2025
4ec6945
chore: use workflow type in apiv2 WorkflowsOutputService
ThyMinimalDev Sep 30, 2025
f75d2df
update worklfow type on update
Sep 30, 2025
bb281ba
chore: use workflow type in apiv2 WorkflowsOutputService
ThyMinimalDev Sep 30, 2025
dfe4a42
Merge branch 'main' into feat/form-submitted-workflow-triggers
ThyMinimalDev Oct 1, 2025
81cb441
fix template body for torm trigger
Oct 1, 2025
6109f12
some UI fixes for email subject/body
Oct 1, 2025
bf384fa
resetting email body when changing form triggers
Oct 1, 2025
9bed8f2
use type field to query workflows
Oct 1, 2025
952ad8a
clean up all old active on values
Oct 1, 2025
57525b0
Merge branch 'main' into feat/form-submitted-workflow-triggers
Oct 1, 2025
c774bb0
remove responseId from all funciton calls
Oct 1, 2025
f04f460
remove undefined from updateTemplate
Oct 1, 2025
210cd6b
refactor: split routing form and event-type workflows code
ThyMinimalDev Oct 2, 2025
7f24b7b
refactor: split routing form and event-type workflows code
ThyMinimalDev Oct 2, 2025
c7b361e
Merge branch 'main' into feat/form-submitted-workflow-triggers
ThyMinimalDev Oct 2, 2025
2033aef
fix template text when adding action
Oct 2, 2025
104a1f5
chore: don't rename WorkflowActivationDto to avoid ci blocking
ThyMinimalDev Oct 2, 2025
dfa4da6
refine update schedule to use only allowed actions
Oct 2, 2025
78b4d46
fix type error
Oct 2, 2025
93d401f
don't allow whatsapp action with form trigger
Oct 2, 2025
b5d0774
fix type error
Oct 2, 2025
2f9f609
Merge branch 'main' into feat/form-submitted-workflow-triggers
ThyMinimalDev Oct 2, 2025
3fa87d0
return early if activeOn array is empty
Oct 3, 2025
91f6d1f
fix: from step type in BaseFormWorkflowStepDto
ThyMinimalDev Oct 3, 2025
74efefb
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Oct 3, 2025
7da184e
fixup! fix: from step type in BaseFormWorkflowStepDto
ThyMinimalDev Oct 3, 2025
8eb135d
api v2 updates
Oct 3, 2025
b5ce055
move all prisma calls to repository (service/workflows.ts)
Oct 3, 2025
70f218a
use FORM_TRIGGER_WORKFLOW_EVENTS for form queries
Oct 3, 2025
a8db17d
use userRepository
Oct 3, 2025
4610dfd
use FORM_TRIGGER_WORKFLOW_EVENTS in isFormTrigger
Oct 3, 2025
755c73c
code clean up
Oct 3, 2025
5c058c6
code clean up
Oct 3, 2025
02da3b9
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Oct 3, 2025
924f785
use repository functions in formSubmissionValidation.ts
Oct 3, 2025
cbf9a7a
Merge branch 'main' into feat/form-submitted-workflow-triggers
Oct 6, 2025
53b05ae
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Oct 7, 2025
e09fbcc
remove action check in update handler
Oct 7, 2025
9077db6
merge main
Oct 9, 2025
2e116e1
add back trpc import
Oct 9, 2025
4cdd890
fix agent repository functions
Oct 9, 2025
afeefda
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
CarinaWolli Oct 9, 2025
6918b54
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
CarinaWolli Oct 9, 2025
7905192
Merge branch 'main' into feat/form-submitted-workflow-triggers
Oct 10, 2025
9b7fabf
Merge branch 'feat/form-submitted-workflow-triggers' into feat/form-s…
Oct 10, 2025
75b1d8d
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Oct 10, 2025
f5cc8ca
add SMS actions to allowed form action constants
Oct 10, 2025
9d68c7b
Merge branch 'main' into feat/form-submitted-no-event-trigger
Oct 13, 2025
a51fd6e
remove unsued import
Oct 13, 2025
5384332
fixes for offset api v2
Oct 13, 2025
3d11c9f
add missing responseId
Oct 13, 2025
4f8ff50
Merge branch 'feat/form-submitted-no-event-trigger' into feat/sms-act…
Oct 13, 2025
2173116
fix failing test
Oct 13, 2025
c88c6c3
fix failing test
Oct 13, 2025
91982bf
fix failing test
Oct 13, 2025
dd26efc
Merge branch 'main' into feat/sms-action-on-form-triggers
Oct 16, 2025
2a4aeb3
remove unused imports
Oct 16, 2025
e0d09b1
chore: handle sms step action for form worklfow in dtos
ThyMinimalDev Oct 16, 2025
826195a
Merge branch 'main' into feat/sms-action-on-form-triggers
ThyMinimalDev Oct 20, 2025
8360d49
Merge branch 'main' into feat/sms-action-on-form-triggers
CarinaWolli Oct 21, 2025
a0d7393
fix e2e test
Oct 21, 2025
31d2342
chore: add test for new routing form action step
ThyMinimalDev Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ describe("OrganizationsTeamsWorkflowsController (E2E)", () => {
invalidWorkflow.steps = [
{
stepNumber: 1,
action: "sms_number",
action: "cal_ai_phone_call",
recipient: PHONE_NUMBER,
template: REMINDER,
verifiedPhoneId: verifiedPhoneId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import {
EMAIL_ADDRESS,
EMAIL_ATTENDEE,
FORM_ALLOWED_STEP_ACTIONS,
SMS_NUMBER,
WorkflowEmailAddressStepDto,
WorkflowEmailAttendeeStepDto,
WorkflowPhoneNumberStepDto,
WorkflowPhoneAttendeeStepDto,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new SMS step DTOs to @ApiExtraModels so their schemas are emitted for the getSchemaPath references; otherwise the generated OpenAPI spec points to missing components.

Prompt for AI agents
Address the following comment on apps/api/v2/src/modules/workflows/inputs/create-form-workflow.ts at line 14:

<comment>Please add the new SMS step DTOs to @ApiExtraModels so their schemas are emitted for the getSchemaPath references; otherwise the generated OpenAPI spec points to missing components.</comment>

<file context>
@@ -7,8 +7,12 @@ import {
   WorkflowEmailAddressStepDto,
   WorkflowEmailAttendeeStepDto,
+  WorkflowPhoneNumberStepDto,
+  WorkflowPhoneAttendeeStepDto,
+  SMS_ATTENDEE,
 } from &quot;./workflow-step.input&quot;;
</file context>
Fix with Cubic

SMS_ATTENDEE,
} from "./workflow-step.input";
import {
RoutingFormWorkflowTriggerDto,
Expand Down Expand Up @@ -85,6 +89,8 @@ export class CreateFormWorkflowDto {
oneOf: [
{ $ref: getSchemaPath(WorkflowEmailAddressStepDto) },
{ $ref: getSchemaPath(WorkflowEmailAttendeeStepDto) },
{ $ref: getSchemaPath(WorkflowPhoneAttendeeStepDto) },
{ $ref: getSchemaPath(WorkflowPhoneNumberStepDto) },
],
type: "array",
})
Expand All @@ -99,8 +105,15 @@ export class CreateFormWorkflowDto {
subTypes: [
{ value: WorkflowEmailAddressStepDto, name: EMAIL_ADDRESS },
{ value: WorkflowEmailAttendeeStepDto, name: EMAIL_ATTENDEE },
{ value: WorkflowPhoneAttendeeStepDto, name: SMS_ATTENDEE },
{ value: WorkflowPhoneNumberStepDto, name: SMS_NUMBER },
],
},
})
steps!: (WorkflowEmailAddressStepDto | WorkflowEmailAttendeeStepDto)[];
steps!: (
| WorkflowEmailAddressStepDto
| WorkflowEmailAttendeeStepDto
| WorkflowPhoneAttendeeStepDto
| WorkflowPhoneNumberStepDto
)[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
EMAIL_ADDRESS,
EMAIL_ATTENDEE,
FORM_ALLOWED_STEP_ACTIONS,
SMS_ATTENDEE,
SMS_NUMBER,
UpdateEmailAddressWorkflowStepDto,
UpdateEmailAttendeeWorkflowStepDto,
UpdateEmailHostWorkflowStepDto,
Expand Down Expand Up @@ -75,6 +77,8 @@ export class UpdateFormWorkflowDto {
oneOf: [
{ $ref: getSchemaPath(UpdateEmailAddressWorkflowStepDto) },
{ $ref: getSchemaPath(UpdateEmailAttendeeWorkflowStepDto) },
{ $ref: getSchemaPath(UpdatePhoneAttendeeWorkflowStepDto) },
{ $ref: getSchemaPath(UpdatePhoneNumberWorkflowStepDto) },
],
type: "array",
})
Expand All @@ -90,8 +94,15 @@ export class UpdateFormWorkflowDto {
subTypes: [
{ value: UpdateEmailAddressWorkflowStepDto, name: EMAIL_ADDRESS },
{ value: UpdateEmailAttendeeWorkflowStepDto, name: EMAIL_ATTENDEE },
{ value: UpdatePhoneAttendeeWorkflowStepDto, name: SMS_ATTENDEE },
{ value: UpdatePhoneNumberWorkflowStepDto, name: SMS_NUMBER },
],
},
})
steps?: (UpdateEmailAddressWorkflowStepDto | UpdateEmailAttendeeWorkflowStepDto)[];
steps?: (
| UpdateEmailAddressWorkflowStepDto
| UpdateEmailAttendeeWorkflowStepDto
| UpdatePhoneNumberWorkflowStepDto
| UpdatePhoneAttendeeWorkflowStepDto
)[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const STEP_ACTIONS = [
CAL_AI_PHONE_CALL,
] as const;

export const FORM_ALLOWED_STEP_ACTIONS = [EMAIL_ATTENDEE, EMAIL_ADDRESS] as const;
export const FORM_ALLOWED_STEP_ACTIONS = [EMAIL_ATTENDEE, EMAIL_ADDRESS, SMS_ATTENDEE, SMS_NUMBER] as const;

export const STEP_ACTIONS_TO_ENUM = {
[EMAIL_HOST]: WorkflowActions.EMAIL_HOST,
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,7 @@
"email_host_action": "send email to host",
"email_attendee_action": "send email to attendees",
"email_attendee_action_form": "Send email to submitted email address",
"sms_attendee_action_form": "Send SMS to submitted phone number",
"sms_attendee_action": "Send SMS to attendee",
"sms_number_action": "send SMS to a specific number",
"send_reminder_sms": "Easily send meeting reminders via SMS to your attendees",
Expand Down
6 changes: 1 addition & 5 deletions packages/features/ee/workflows/api/scheduleSMSReminders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,7 @@ export async function handler(req: NextRequest) {
}

if (message?.length && message?.length > 0 && sendTo) {
const smsMessageWithoutOptOut = message;

if (process.env.TWILIO_OPT_OUT_ENABLED === "true") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this check inside addOptOutMessage

message = await WorkflowOptOutService.addOptOutMessage(message, locale || "en");
}
const smsMessageWithoutOptOut = await WorkflowOptOutService.addOptOutMessage(message, locale || "en");
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assigns the opt-out footer to smsMessageWithoutOptOut so the SMS body stays unchanged, causing scheduled SMS messages to miss the required opt-out text while the fallback email gains it. Please append the opt-out footer to message (the SMS body) and keep smsMessageWithoutOptOut equal to the original message.

Prompt for AI agents
Address the following comment on packages/features/ee/workflows/api/scheduleSMSReminders.ts at line 174:

<comment>This assigns the opt-out footer to `smsMessageWithoutOptOut` so the SMS body stays unchanged, causing scheduled SMS messages to miss the required opt-out text while the fallback email gains it. Please append the opt-out footer to `message` (the SMS body) and keep `smsMessageWithoutOptOut` equal to the original message.</comment>

<file context>
@@ -171,11 +171,7 @@ export async function handler(req: NextRequest) {
-        if (process.env.TWILIO_OPT_OUT_ENABLED === &quot;true&quot;) {
-          message = await WorkflowOptOutService.addOptOutMessage(message, locale || &quot;en&quot;);
-        }
+        const smsMessageWithoutOptOut = await WorkflowOptOutService.addOptOutMessage(message, locale || &quot;en&quot;);
 
         const scheduledNotification = await scheduleSmsOrFallbackEmail({
</file context>
Fix with Cubic


const scheduledNotification = await scheduleSmsOrFallbackEmail({
twilioData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export default function WorkflowDetailsPage(props: Props) {
if (isFormTrigger(form.getValues("trigger"))) {
if (option.value === WorkflowActions.EMAIL_ATTENDEE) {
label = t("email_attendee_action_form");
} else if (option.value === WorkflowActions.SMS_ATTENDEE) {
label = t("sms_attendee_action_form");
}
}

Expand Down Expand Up @@ -167,11 +169,11 @@ export default function WorkflowDetailsPage(props: Props) {
<>
<div>
<FormCard
className="border-muted mb-0"
className="mb-0 border-muted"
collapsible={false}
label={
<div className="flex items-center gap-2 pb-2 pt-1">
<div className="border-subtle text-subtle ml-1 rounded-lg border p-1">
<div className="flex gap-2 items-center pt-1 pb-2">
<div className="p-1 ml-1 rounded-lg border border-subtle text-subtle">
<Icon name="zap" size="16" />
</div>
<div className="text-sm font-medium leading-none">{t("trigger")}</div>
Expand Down Expand Up @@ -208,11 +210,11 @@ export default function WorkflowDetailsPage(props: Props) {
<div key={index}>
<FormCard
key={step.id}
className="bg-muted border-muted mb-0"
className="mb-0 bg-muted border-muted"
collapsible={false}
label={
<div className="flex items-center gap-2 pb-2 pt-1">
<div className="border-subtle text-subtle rounded-lg border p-1">
<div className="flex gap-2 items-center pt-1 pb-2">
<div className="p-1 rounded-lg border border-subtle text-subtle">
<Icon name="arrow-right" size="16" />
</div>
<div className="text-sm font-medium leading-none">{t("action")}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,10 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
});

const hasAiAction = hasCalAIAction(steps);
const hasSMSAction = steps.some((s) => isSMSAction(s.action));
const hasWhatsappAction = steps.some((s) => isWhatsappAction(s.action));
const hasEmailToHostAction = steps.some((s) => s.action === WorkflowActions.EMAIL_HOST);
const hasWhatsappAction = steps.some((s) => isWhatsappAction(s.action));

const disallowFormTriggers = hasAiAction || hasSMSAction || hasEmailToHostAction || hasWhatsappAction;
const disallowFormTriggers = hasAiAction || hasEmailToHostAction || hasWhatsappAction;

const filteredTriggerOptions = triggerOptions.filter(
(option) => !(isFormTrigger(option.value) && disallowFormTriggers)
Expand Down
2 changes: 2 additions & 0 deletions packages/features/ee/workflows/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,6 @@ export const FORM_TRIGGER_WORKFLOW_EVENTS: WorkflowTriggerEvents[] = [
export const ALLOWED_FORM_WORKFLOW_ACTIONS = [
WorkflowActions.EMAIL_ATTENDEE,
WorkflowActions.EMAIL_ADDRESS,
WorkflowActions.SMS_ATTENDEE,
WorkflowActions.SMS_NUMBER,
] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ const scheduleEmailReminderForEvt = async (args: scheduleEmailReminderArgs & { e
});
};

// sends all immediately, no scheduling needed
const scheduleEmailReminderForForm = async (
args: scheduleEmailReminderArgs & {
formData: FormSubmissionData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ const processWorkflowStep = async (
};

if (isSMSAction(step.action)) {
if (!evt) {
// SMS action not not yet supported for form triggers
return;
}
const sendTo = step.action === WorkflowActions.SMS_ATTENDEE ? smsReminderNumber : step.sendTo;

await scheduleSMSReminder({
Expand All @@ -127,7 +123,7 @@ const processWorkflowStep = async (
message: step.reminderBody || "",
sender: step.sender,
isVerificationPending: step.numberVerificationPending,
evt,
...contextData,
});
} else if (
step.action === WorkflowActions.EMAIL_ATTENDEE ||
Expand Down
Loading
Loading