Skip to content
Merged
Show file tree
Hide file tree
Changes from 230 commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
b0d048a
feat: add 5 new workflow triggers for booking events
devin-ai-integration[bot] Aug 13, 2025
a327a38
fix: type check, remove as any
Amit91848 Aug 13, 2025
a2fef5f
feat: add workflow trigger for BOOKING_REQUESTED in handleNewBooking.ts
devin-ai-integration[bot] Aug 13, 2025
1a86cb0
Merge branch 'devin/1755107037-add-workflow-triggers' of https://git-…
devin-ai-integration[bot] Aug 13, 2025
b161f8f
fix: resolve type errors in workflow trigger implementations
devin-ai-integration[bot] Aug 13, 2025
3f4f743
feat: add workflow test configurations for new booking triggers
devin-ai-integration[bot] Aug 13, 2025
a4e3015
fix: add missing mockSuccessfulVideoMeetingCreation import to confirm…
devin-ai-integration[bot] Aug 13, 2025
dd791ff
add new triggers
Aug 14, 2025
94ebb23
Merge branch 'main' into devin/1755107037-add-workflow-triggers
Amit91848 Aug 18, 2025
1062d1a
refactor: improve _scheduleWorkflowReminders readability and add miss…
devin-ai-integration[bot] Aug 18, 2025
9025eaa
Merge branch 'devin/1755107037-add-workflow-triggers' of https://git-…
devin-ai-integration[bot] Aug 18, 2025
190eb0b
only show customt emplate for form triggers
Aug 18, 2025
3cd2d7e
filter outside scheduleWorkflowReminder
Amit91848 Aug 18, 2025
a39ccf4
fix type check
Amit91848 Aug 18, 2025
265f852
chore: add more tests
Amit91848 Aug 18, 2025
7642992
test: add comprehensive unit tests for handleMarkNoShow with webhook …
devin-ai-integration[bot] Aug 18, 2025
53fe81e
Revert "test: add comprehensive unit tests for handleMarkNoShow with …
Amit91848 Aug 19, 2025
32910d8
fix: add new workflow triggers to api/v2
Amit91848 Aug 19, 2025
e037154
update swagger docs
Amit91848 Aug 19, 2025
2a187ea
fix: e2e
Amit91848 Aug 19, 2025
d0e0fee
fix type check
Amit91848 Aug 19, 2025
505ff8e
fix tests, add test for before after events
Amit91848 Aug 19, 2025
37c78b0
fix unit tests
Amit91848 Aug 19, 2025
b945b88
Merge branch 'main' into devin/1755107037-add-workflow-triggers
Amit91848 Aug 19, 2025
ac54670
revert confirm.handler.test
Amit91848 Aug 19, 2025
32a26e5
Merge branch 'devin/1755107037-add-workflow-triggers' of https://gith…
Amit91848 Aug 19, 2025
0f0e2fa
fix: unit tests
Amit91848 Aug 19, 2025
75d1235
dummy form variables
Aug 20, 2025
edcbca5
add routing forms to active on dropdown
Aug 20, 2025
2feb0ea
add migration file
Aug 20, 2025
1278b63
Ui fixes for variables dropdown
Aug 20, 2025
7825c4a
remove other translation keys
Aug 20, 2025
2168142
Merge branch 'fix/add-variables-dropdown' into feat/routing-form-work…
Aug 20, 2025
8d58550
review fixes
Amit91848 Aug 20, 2025
2ea8c1e
allow routing forms for activeOn
Aug 21, 2025
61d231a
use repository function to get routing forms
Aug 21, 2025
985b777
remove unnecessary code
Aug 21, 2025
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
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
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
b891d17
Merge branch 'main' into feat/form-submitted-workflow-triggers
Udit-takkar Sep 19, 2025
f7d5e57
code 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
acccf59
fix bug with key
Sep 22, 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
7da184e
fixup! fix: from step type in BaseFormWorkflowStepDto
ThyMinimalDev 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
cbf9a7a
Merge branch 'main' into feat/form-submitted-workflow-triggers
Oct 6, 2025
9077db6
merge main
Oct 9, 2025
2e116e1
add back trpc import
Oct 9, 2025
4cdd890
fix agent repository functions
Oct 9, 2025
7905192
Merge branch 'main' into feat/form-submitted-workflow-triggers
Oct 10, 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 @@ -9,7 +9,7 @@ import {
import { Request } from "express";

@Injectable()
export class IsWorkflowInTeam implements CanActivate {
export class IsEventTypeWorkflowInTeam implements CanActivate {
constructor(private workflowsRepository: WorkflowsRepository) {}

async canActivate(context: ExecutionContext): Promise<boolean> {
Expand Down Expand Up @@ -41,10 +41,13 @@ export class IsWorkflowInTeam implements CanActivate {
teamId: string,
workflowId: string
): Promise<{ canAccess: boolean; workflow?: WorkflowType }> {
const workflow = await this.workflowsRepository.getTeamWorkflowById(Number(teamId), Number(workflowId));
const workflow = await this.workflowsRepository.getEventTypeTeamWorkflowById(
Number(teamId),
Number(workflowId)
);

if (!workflow) {
throw new NotFoundException(`IsWorkflowInTeam - workflow (${workflowId}) not found.`);
throw new NotFoundException(`IsWorkflowInTeam - event-type workflow (${workflowId}) not found.`);
}

if (workflow.teamId === Number(teamId)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { WorkflowsRepository, WorkflowType } from "@/modules/workflows/workflows.repository";
import {
Injectable,
CanActivate,
ExecutionContext,
ForbiddenException,
NotFoundException,
} from "@nestjs/common";
import { Request } from "express";

@Injectable()
export class IsRoutingFormWorkflowInTeam implements CanActivate {
constructor(private workflowsRepository: WorkflowsRepository) {}

async canActivate(context: ExecutionContext): Promise<boolean> {
const request = context.switchToHttp().getRequest<Request & { workflow?: WorkflowType }>();
const teamId: string = request.params.teamId;
const workflowId: string = request.params.workflowId;

if (!workflowId) {
throw new ForbiddenException("IsWorkflowInTeam - No workflow found in request params.");
}

if (!teamId) {
throw new ForbiddenException("IsWorkflowInTeam - No team id found in request params.");
}

const { canAccess, workflow } = await this.checkIfWorkflowIsInTeam(teamId, workflowId);

if (!canAccess) {
throw new ForbiddenException(
`IsTeamInOrg - Workflow with id=${workflowId} is not part of the team with id=${teamId}.`
);
}

request.workflow = workflow;
return true;
}

async checkIfWorkflowIsInTeam(
teamId: string,
workflowId: string
): Promise<{ canAccess: boolean; workflow?: WorkflowType }> {
const workflow = await this.workflowsRepository.getRoutingFormTeamWorkflowById(
Number(teamId),
Number(workflowId)
);

if (!workflow) {
throw new NotFoundException(`IsWorkflowInTeam - routing form workflow (${workflowId}) not found.`);
}

if (workflow.teamId === Number(teamId)) {
return { canAccess: true, workflow };
}

return { canAccess: false };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import { OrganizationsStripeService } from "@/modules/organizations/stripe/servi
import { OrganizationsTeamsController } from "@/modules/organizations/teams/index/organizations-teams.controller";
import { OrganizationsTeamsRepository } from "@/modules/organizations/teams/index/organizations-teams.repository";
import { OrganizationsTeamsService } from "@/modules/organizations/teams/index/services/organizations-teams.service";
import { OrganizationsTeamsMembershipsController } from "@/modules/organizations/teams/memberships/organizations-teams-memberships.controller";
import { OrganizationsTeamsInviteController } from "@/modules/organizations/teams/invite/organizations-teams-invite.controller";
import { OrganizationsTeamsMembershipsController } from "@/modules/organizations/teams/memberships/organizations-teams-memberships.controller";
import { OrganizationsTeamsMembershipsRepository } from "@/modules/organizations/teams/memberships/organizations-teams-memberships.repository";
import { OrganizationsTeamsMembershipsService } from "@/modules/organizations/teams/memberships/services/organizations-teams-memberships.service";
import { OrganizationsTeamsRoutingFormsModule } from "@/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module";
Expand Down Expand Up @@ -76,7 +76,8 @@ import { UsersModule } from "@/modules/users/users.module";
import { TeamsVerifiedResourcesRepository } from "@/modules/verified-resources/teams-verified-resources.repository";
import { WebhooksService } from "@/modules/webhooks/services/webhooks.service";
import { WebhooksRepository } from "@/modules/webhooks/webhooks.repository";
import { TeamWorkflowsService } from "@/modules/workflows/services/team-workflows.service";
import { TeamEventTypeWorkflowsService } from "@/modules/workflows/services/team-event-type-workflows.service";
import { TeamRoutingFormWorkflowsService } from "@/modules/workflows/services/team-routing-form-workflows.service";
import { WorkflowsInputService } from "@/modules/workflows/services/workflows.input.service";
import { WorkflowsOutputService } from "@/modules/workflows/services/workflows.output.service";
import { WorkflowsRepository } from "@/modules/workflows/workflows.repository";
Expand Down Expand Up @@ -145,7 +146,8 @@ import { Module } from "@nestjs/common";
TokensRepository,
TeamsVerifiedResourcesRepository,
WorkflowsRepository,
TeamWorkflowsService,
TeamEventTypeWorkflowsService,
TeamRoutingFormWorkflowsService,
WorkflowsInputService,
WorkflowsOutputService,
TeamsSchedulesService,
Expand Down
Loading
Loading