Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
126a42c
feat(notification): slack, email, webhook notifications from logs
icecrasher321 Dec 2, 2025
5928b92
retain search params for filters to link in notification
icecrasher321 Dec 2, 2025
8e6c509
add alerting rules
icecrasher321 Dec 2, 2025
5d4bcdc
update selector
icecrasher321 Dec 2, 2025
3b8fad2
fix lint
icecrasher321 Dec 2, 2025
ed82ded
add limits on num of emails and notification triggers per workspace
icecrasher321 Dec 2, 2025
222bd4e
address greptile comments
icecrasher321 Dec 2, 2025
d0fdb86
add search to combobox
icecrasher321 Dec 2, 2025
4e14862
move notifications to react query
icecrasher321 Dec 2, 2025
0e58fae
fix lint
icecrasher321 Dec 2, 2025
a004934
fix email formatting
icecrasher321 Dec 2, 2025
6cd5707
add more alert types
icecrasher321 Dec 2, 2025
f0b525f
Merge branch 'staging' into feat/notifications-workflow-execs
icecrasher321 Dec 2, 2025
cfc1954
fix imports
icecrasher321 Dec 2, 2025
d63bb9e
fix test route
icecrasher321 Dec 2, 2025
cc5a165
Merge branch 'staging' into feat/notifications-workflow-execs
icecrasher321 Dec 4, 2025
30b0391
use emcn componentfor modal
icecrasher321 Dec 4, 2025
6d1ff0c
refactor: consolidate notification config fields into jsonb objects
icecrasher321 Dec 4, 2025
6c8019f
regen migration
icecrasher321 Dec 4, 2025
f09f2dc
fix delete notif modal ui
icecrasher321 Dec 5, 2025
909b349
make them multiselect dropdowns
icecrasher321 Dec 5, 2025
e35517f
update tag styling
icecrasher321 Dec 5, 2025
747e820
combobox font size with multiselect tags'
icecrasher321 Dec 5, 2025
64305ab
Merge staging into feat/notifications-workflow-execs
icecrasher321 Dec 5, 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
Prev Previous commit
Next Next commit
regen migration
  • Loading branch information
icecrasher321 committed Dec 4, 2025
commit 6c8019f77dec9db58c6047649b9137654b92382b
96 changes: 96 additions & 0 deletions packages/db/migrations/0116_flimsy_shape.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
CREATE TYPE "public"."notification_delivery_status" AS ENUM('pending', 'in_progress', 'success', 'failed');--> statement-breakpoint
CREATE TYPE "public"."notification_type" AS ENUM('webhook', 'email', 'slack');--> statement-breakpoint
CREATE TABLE "workspace_notification_delivery" (
"id" text PRIMARY KEY NOT NULL,
"subscription_id" text NOT NULL,
"workflow_id" text NOT NULL,
"execution_id" text NOT NULL,
"status" "notification_delivery_status" DEFAULT 'pending' NOT NULL,
"attempts" integer DEFAULT 0 NOT NULL,
"last_attempt_at" timestamp,
"next_attempt_at" timestamp,
"response_status" integer,
"response_body" text,
"error_message" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "workspace_notification_subscription" (
"id" text PRIMARY KEY NOT NULL,
"workspace_id" text NOT NULL,
"notification_type" "notification_type" NOT NULL,
"workflow_ids" text[] DEFAULT '{}'::text[] NOT NULL,
"all_workflows" boolean DEFAULT false NOT NULL,
"level_filter" text[] DEFAULT ARRAY['info', 'error']::text[] NOT NULL,
"trigger_filter" text[] DEFAULT ARRAY['api', 'webhook', 'schedule', 'manual', 'chat']::text[] NOT NULL,
"include_final_output" boolean DEFAULT false NOT NULL,
"include_trace_spans" boolean DEFAULT false NOT NULL,
"include_rate_limits" boolean DEFAULT false NOT NULL,
"include_usage_data" boolean DEFAULT false NOT NULL,
"webhook_config" jsonb,
"email_recipients" text[],
"slack_config" jsonb,
"alert_config" jsonb,
"last_alert_at" timestamp,
"active" boolean DEFAULT true NOT NULL,
"created_by" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
INSERT INTO "workspace_notification_subscription" (
"id",
"workspace_id",
"notification_type",
"workflow_ids",
"all_workflows",
"level_filter",
"trigger_filter",
"include_final_output",
"include_trace_spans",
"include_rate_limits",
"include_usage_data",
"webhook_config",
"active",
"created_by",
"created_at",
"updated_at"
)
SELECT
wlw.id,
w.workspace_id,
'webhook'::"notification_type",
ARRAY[wlw.workflow_id],
false,
wlw.level_filter,
wlw.trigger_filter,
wlw.include_final_output,
wlw.include_trace_spans,
wlw.include_rate_limits,
wlw.include_usage_data,
jsonb_build_object('url', wlw.url, 'secret', wlw.secret),
wlw.active,
w.user_id,
wlw.created_at,
wlw.updated_at
FROM workflow_log_webhook wlw
JOIN workflow w ON w.id = wlw.workflow_id
WHERE w.workspace_id IS NOT NULL;--> statement-breakpoint
DROP TABLE "workflow_log_webhook_delivery" CASCADE;--> statement-breakpoint
DROP TABLE "workflow_log_webhook" CASCADE;--> statement-breakpoint
ALTER TABLE "workspace_notification_delivery" ADD CONSTRAINT "workspace_notification_delivery_subscription_id_workspace_notification_subscription_id_fk" FOREIGN KEY ("subscription_id") REFERENCES "public"."workspace_notification_subscription"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "workspace_notification_delivery" ADD CONSTRAINT "workspace_notification_delivery_workflow_id_workflow_id_fk" FOREIGN KEY ("workflow_id") REFERENCES "public"."workflow"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "workspace_notification_subscription" ADD CONSTRAINT "workspace_notification_subscription_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "workspace_notification_subscription" ADD CONSTRAINT "workspace_notification_subscription_created_by_user_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "workspace_notification_delivery_subscription_id_idx" ON "workspace_notification_delivery" USING btree ("subscription_id");--> statement-breakpoint
CREATE INDEX "workspace_notification_delivery_execution_id_idx" ON "workspace_notification_delivery" USING btree ("execution_id");--> statement-breakpoint
CREATE INDEX "workspace_notification_delivery_status_idx" ON "workspace_notification_delivery" USING btree ("status");--> statement-breakpoint
CREATE INDEX "workspace_notification_delivery_next_attempt_idx" ON "workspace_notification_delivery" USING btree ("next_attempt_at");--> statement-breakpoint
CREATE INDEX "workspace_notification_workspace_id_idx" ON "workspace_notification_subscription" USING btree ("workspace_id");--> statement-breakpoint
CREATE INDEX "workspace_notification_active_idx" ON "workspace_notification_subscription" USING btree ("active");--> statement-breakpoint
CREATE INDEX "workspace_notification_type_idx" ON "workspace_notification_subscription" USING btree ("notification_type");--> statement-breakpoint
ALTER TABLE "settings" DROP COLUMN "auto_pan";--> statement-breakpoint
ALTER TABLE "settings" DROP COLUMN "console_expanded_by_default";--> statement-breakpoint
ALTER TABLE "settings" DROP COLUMN "show_floating_controls";--> statement-breakpoint
DROP TYPE "public"."webhook_delivery_status";
Loading