diff --git a/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte b/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte
index 2419999475..45d3b17940 100644
--- a/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte
+++ b/packages/builder/src/components/automation/AutomationPanel/BlockList/AutomationBlock.svelte
@@ -1,11 +1,15 @@
@@ -64,6 +79,13 @@
{:else if value.customType === 'row'}
+ {:else if value.customType === 'webhookUrl'}
+
+
+ copyToClipboard(fullWebhookURL(block.inputs[key]))}>
+
+
+
{:else if value.type === 'string' || value.type === 'number'}
diff --git a/packages/server/package.json b/packages/server/package.json
index 03002a0579..87a91da198 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -59,6 +59,7 @@
"fs-extra": "^8.1.0",
"jimp": "^0.16.1",
"joi": "^17.2.1",
+ "jsonschema": "^1.4.0",
"jsonwebtoken": "^8.5.1",
"koa": "^2.7.0",
"koa-body": "^4.2.0",
@@ -77,6 +78,7 @@
"sanitize-s3-objectkey": "^0.0.1",
"squirrelly": "^7.5.0",
"tar-fs": "^2.1.0",
+ "to-json-schema": "^0.2.5",
"uuid": "^3.3.2",
"validate.js": "^0.13.1",
"worker-farm": "^1.7.0",
diff --git a/packages/server/src/api/controllers/automation.js b/packages/server/src/api/controllers/automation.js
index 92391da7e9..1647d59413 100644
--- a/packages/server/src/api/controllers/automation.js
+++ b/packages/server/src/api/controllers/automation.js
@@ -2,8 +2,10 @@ const CouchDB = require("../../db")
const actions = require("../../automations/actions")
const logic = require("../../automations/logic")
const triggers = require("../../automations/triggers")
+const webhooks = require("./webhook")
const { getAutomationParams, generateAutomationID } = require("../../db/utils")
+const WH_STEP_ID = triggers.BUILTIN_DEFINITIONS.WEBHOOK.stepId
/*************************
* *
* BUILDER FUNCTIONS *
@@ -30,6 +32,68 @@ function cleanAutomationInputs(automation) {
return automation
}
+/**
+ * This function handles checking if any webhooks need to be created or deleted for automations.
+ * @param {object} user The user object, including all auth info
+ * @param {object|undefined} oldAuto The old automation object if updating/deleting
+ * @param {object|undefined} newAuto The new automation object if creating/updating
+ * @returns {Promise