diff --git a/lerna.json b/lerna.json
index 6c507bdd92..f058050495 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "2.14.8",
+ "version": "2.15.0",
"npmClient": "yarn",
"packages": [
"packages/*",
diff --git a/packages/account-portal b/packages/account-portal
index 319c8499e7..1bc0128714 160000
--- a/packages/account-portal
+++ b/packages/account-portal
@@ -1 +1 @@
-Subproject commit 319c8499e7c3d33fbb96cf4d73a922690709686c
+Subproject commit 1bc012871496ff55e376931b620075b565e34d09
diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json
index 343bc67449..d6325e1de9 100644
--- a/packages/backend-core/package.json
+++ b/packages/backend-core/package.json
@@ -32,7 +32,7 @@
"bcryptjs": "2.4.3",
"bull": "4.10.1",
"correlation-id": "4.0.0",
- "dd-trace": "3.13.2",
+ "dd-trace": "5.0.0",
"dotenv": "16.0.1",
"ioredis": "5.3.2",
"joi": "17.6.0",
diff --git a/packages/builder/package.json b/packages/builder/package.json
index 9472c51965..273994ed0e 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -66,6 +66,7 @@
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
+ "@zerodevx/svelte-json-view": "^1.0.7",
"codemirror": "^5.59.0",
"dayjs": "^1.10.8",
"downloadjs": "1.4.7",
diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
index 9f7aaa68ce..ef591d5635 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
@@ -19,10 +19,15 @@
export let lastStep
let syncAutomationsEnabled = $licensing.syncAutomationsEnabled
+ let triggerAutomationRunEnabled = $licensing.triggerAutomationRunEnabled
let collectBlockAllowedSteps = [TriggerStepID.APP, TriggerStepID.WEBHOOK]
let selectedAction
let actionVal
let actions = Object.entries($automationStore.blockDefinitions.ACTION)
+ let lockedFeatures = [
+ ActionStepID.COLLECT,
+ ActionStepID.TRIGGER_AUTOMATION_RUN,
+ ]
$: collectBlockExists = checkForCollectStep($selectedAutomation)
@@ -36,6 +41,10 @@
disabled: !lastStep || !syncAutomationsEnabled || collectBlockExists,
message: collectDisabledMessage(),
},
+ TRIGGER_AUTOMATION_RUN: {
+ disabled: !triggerAutomationRunEnabled,
+ message: collectDisabledMessage(),
+ },
}
}
@@ -149,7 +158,7 @@
{action.name}
- {#if isDisabled && !syncAutomationsEnabled && action.stepId === ActionStepID.COLLECT}
+ {#if isDisabled && !syncAutomationsEnabled && !triggerAutomationRunEnabled && lockedFeatures.includes(action.stepId)}
Premium
diff --git a/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte b/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
index 89406f15d8..9fbc4b6bc1 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/TestDisplay.svelte
@@ -1,7 +1,8 @@
-
-
-
-
-
-
+
+
+ modal.show()}
+ />
+
+
+ {#each filteredAutomations as automation}
+
selectAutomation(automation._id)}
+ selectedBy={$userSelectedResourceMap[automation._id]}
+ >
+
+
+ {/each}
+
+ {#if showNoResults}
+
+
+ There aren't any automations matching that name
+
+
+ {/if}
+
+
diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
index 158ecd8281..a5a3165aeb 100644
--- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
+++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
@@ -28,6 +28,7 @@
import CodeEditorModal from "./CodeEditorModal.svelte"
import QuerySelector from "./QuerySelector.svelte"
import QueryParamSelector from "./QueryParamSelector.svelte"
+ import AutomationSelector from "./AutomationSelector.svelte"
import CronBuilder from "./CronBuilder.svelte"
import Editor from "components/integration/QueryEditor.svelte"
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
@@ -51,7 +52,6 @@
export let testData
export let schemaProperties
export let isTestModal = false
-
let webhookModal
let drawer
let fillWidth = true
@@ -101,7 +101,6 @@
}
}
}
-
const onChange = Utils.sequential(async (e, key) => {
// We need to cache the schema as part of the definition because it is
// used in the server to detect relationships. It would be far better to
@@ -145,6 +144,7 @@
if (!block || !automation) {
return []
}
+
// Find previous steps to the selected one
let allSteps = [...automation.steps]
@@ -156,22 +156,96 @@
// Extract all outputs from all previous steps as available bindingsx§x
let bindings = []
let loopBlockCount = 0
+ const addBinding = (name, value, icon, idx, isLoopBlock, bindingName) => {
+ const runtimeBinding = determineRuntimeBinding(name, idx, isLoopBlock)
+ const categoryName = determineCategoryName(idx, isLoopBlock, bindingName)
+
+ bindings.push(
+ createBindingObject(
+ name,
+ value,
+ icon,
+ idx,
+ loopBlockCount,
+ isLoopBlock,
+ runtimeBinding,
+ categoryName,
+ bindingName
+ )
+ )
+ }
+
+ const determineRuntimeBinding = (name, idx, isLoopBlock) => {
+ let runtimeName
+
+ /* Begin special cases for generating custom schemas based on triggers */
+ if (idx === 0 && automation.trigger?.event === "app:trigger") {
+ return `trigger.fields.${name}`
+ }
+
+ if (
+ (idx === 0 && automation.trigger?.event === "row:update") ||
+ automation.trigger?.event === "row:save"
+ ) {
+ if (name !== "id" && name !== "revision") return `trigger.row.${name}`
+ }
+ /* End special cases for generating custom schemas based on triggers */
+
+ if (isLoopBlock) {
+ runtimeName = `loop.${name}`
+ } else if (block.name.startsWith("JS")) {
+ runtimeName = `steps[${idx - loopBlockCount}].${name}`
+ } else {
+ runtimeName = `steps.${idx - loopBlockCount}.${name}`
+ }
+ return idx === 0 ? `trigger.${name}` : runtimeName
+ }
+
+ const determineCategoryName = (idx, isLoopBlock, bindingName) => {
+ if (idx === 0) return "Trigger outputs"
+ if (isLoopBlock) return "Loop Outputs"
+ return bindingName
+ ? `${bindingName} outputs`
+ : `Step ${idx - loopBlockCount} outputs`
+ }
+
+ const createBindingObject = (
+ name,
+ value,
+ icon,
+ idx,
+ loopBlockCount,
+ isLoopBlock,
+ runtimeBinding,
+ categoryName,
+ bindingName
+ ) => {
+ return {
+ readableBinding: bindingName
+ ? `${bindingName}.${name}`
+ : runtimeBinding,
+ runtimeBinding,
+ type: value.type,
+ description: value.description,
+ icon,
+ category: categoryName,
+ display: {
+ type: value.type,
+ name,
+ rank: isLoopBlock ? idx + 1 : idx - loopBlockCount,
+ },
+ }
+ }
+
for (let idx = 0; idx < blockIdx; idx++) {
let wasLoopBlock = allSteps[idx - 1]?.stepId === ActionStepID.LOOP
let isLoopBlock =
allSteps[idx]?.stepId === ActionStepID.LOOP &&
- allSteps.find(x => x.blockToLoop === block.id)
+ allSteps.some(x => x.blockToLoop === block.id)
+ let schema = cloneDeep(allSteps[idx]?.schema?.outputs?.properties) ?? {}
+ let bindingName =
+ automation.stepNames?.[allSteps[idx - loopBlockCount].id]
- // If the previous block was a loop block, decrement the index so the following
- // steps are in the correct order
- if (wasLoopBlock) {
- loopBlockCount++
- continue
- }
-
- let schema = allSteps[idx]?.schema?.outputs?.properties ?? {}
-
- // If its a Loop Block, we need to add this custom schema
if (isLoopBlock) {
schema = {
currentItem: {
@@ -180,54 +254,45 @@
},
}
}
- const outputs = Object.entries(schema)
- let bindingIcon = ""
- let bindingRank = 0
- if (idx === 0) {
- bindingIcon = automation.trigger.icon
- } else if (isLoopBlock) {
- bindingIcon = "Reuse"
- bindingRank = idx + 1
- } else {
- bindingIcon = allSteps[idx].icon
- bindingRank = idx - loopBlockCount
+
+ if (idx === 0 && automation.trigger?.event === "app:trigger") {
+ schema = Object.fromEntries(
+ Object.keys(automation.trigger.inputs.fields || []).map(key => [
+ key,
+ { type: automation.trigger.inputs.fields[key] },
+ ])
+ )
}
- let bindingName =
- automation.stepNames?.[allSteps[idx - loopBlockCount].id]
- bindings = bindings.concat(
- outputs.map(([name, value]) => {
- let runtimeName = isLoopBlock
- ? `loop.${name}`
- : block.name.startsWith("JS")
- ? `steps[${idx - loopBlockCount}].${name}`
- : `steps.${idx - loopBlockCount}.${name}`
- const runtime = idx === 0 ? `trigger.${name}` : runtimeName
-
- let categoryName
- if (idx === 0) {
- categoryName = "Trigger outputs"
- } else if (isLoopBlock) {
- categoryName = "Loop Outputs"
- } else if (bindingName) {
- categoryName = `${bindingName} outputs`
- } else {
- categoryName = `Step ${idx - loopBlockCount} outputs`
+ if (
+ (idx === 0 && automation.trigger.event === "row:update") ||
+ (idx === 0 && automation.trigger.event === "row:save")
+ ) {
+ let table = $tables.list.find(
+ table => table._id === automation.trigger.inputs.tableId
+ )
+ // We want to generate our own schema for the bindings from the table schema itself
+ for (const key in table?.schema) {
+ schema[key] = {
+ type: table.schema[key].type,
}
+ }
+ // remove the original binding
+ delete schema.row
+ }
+ let icon =
+ idx === 0
+ ? automation.trigger.icon
+ : isLoopBlock
+ ? "Reuse"
+ : allSteps[idx].icon
- return {
- readableBinding: bindingName ? `${bindingName}.${name}` : runtime,
- runtimeBinding: runtime,
- type: value.type,
- description: value.description,
- icon: bindingIcon,
- category: categoryName,
- display: {
- type: value.type,
- name: name,
- rank: bindingRank,
- },
- }
- })
+ if (wasLoopBlock) {
+ loopBlockCount++
+ continue
+ }
+
+ Object.entries(schema).forEach(([name, value]) =>
+ addBinding(name, value, icon, idx, isLoopBlock, bindingName)
)
}
@@ -245,10 +310,8 @@
})
)
}
-
return bindings
}
-
function lookForFilters(properties) {
if (!properties) {
return []
@@ -286,7 +349,8 @@
value.customType !== "code" &&
value.customType !== "queryParams" &&
value.customType !== "cron" &&
- value.customType !== "triggerSchema"
+ value.customType !== "triggerSchema" &&
+ value.customType !== "automationFields"
)
}
@@ -421,6 +485,12 @@
on:change={e => onChange(e, key)}
value={inputData[key]}
/>
+ {:else if value.customType === "automationFields"}
+ onChange(e, key)}
+ value={inputData[key]}
+ {bindings}
+ />
{:else if value.customType === "queryParams"}
onChange(e, key)}
diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationSelector.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationSelector.svelte
new file mode 100644
index 0000000000..7e3ba92420
--- /dev/null
+++ b/packages/builder/src/components/automation/SetupPanel/AutomationSelector.svelte
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+{#if Object.keys(automationFields)}
+ {#each Object.keys(automationFields) as field}
+
+
+
+ onChange(e, field)}
+ type="string"
+ {bindings}
+ fillWidth={true}
+ updateOnChange={false}
+ />
+
+
+ {/each}
+{/if}
+
+
diff --git a/packages/builder/src/constants/backend/automations.js b/packages/builder/src/constants/backend/automations.js
index f89a126d3c..6981418fa7 100644
--- a/packages/builder/src/constants/backend/automations.js
+++ b/packages/builder/src/constants/backend/automations.js
@@ -21,6 +21,7 @@ export const ActionStepID = {
QUERY_ROWS: "QUERY_ROWS",
LOOP: "LOOP",
COLLECT: "COLLECT",
+ TRIGGER_AUTOMATION_RUN: "TRIGGER_AUTOMATION_RUN",
// these used to be lowercase step IDs, maintain for backwards compat
discord: "discord",
slack: "slack",
diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js
index 3197822e53..8fef367f77 100644
--- a/packages/builder/src/stores/portal/licensing.js
+++ b/packages/builder/src/stores/portal/licensing.js
@@ -125,6 +125,10 @@ export const createLicensingStore = () => {
const syncAutomationsEnabled = license.features.includes(
Constants.Features.SYNC_AUTOMATIONS
)
+ const triggerAutomationRunEnabled = license.features.includes(
+ Constants.Features.TRIGGER_AUTOMATION_RUN
+ )
+
const perAppBuildersEnabled = license.features.includes(
Constants.Features.APP_BUILDERS
)
@@ -147,6 +151,7 @@ export const createLicensingStore = () => {
auditLogsEnabled,
enforceableSSO,
syncAutomationsEnabled,
+ triggerAutomationRunEnabled,
isViewPermissionsEnabled,
perAppBuildersEnabled,
}
diff --git a/packages/pro b/packages/pro
index 8c466d6ef2..9d80daaa5b 160000
--- a/packages/pro
+++ b/packages/pro
@@ -1 +1 @@
-Subproject commit 8c466d6ef2a0c09b843ef63276793ab5af2e96f7
+Subproject commit 9d80daaa5b79da68730d6c5f497f629c47a78ef8
diff --git a/packages/server/__mocks__/@budibase/pro.ts b/packages/server/__mocks__/@budibase/pro.ts
new file mode 100644
index 0000000000..3f0c35d725
--- /dev/null
+++ b/packages/server/__mocks__/@budibase/pro.ts
@@ -0,0 +1,12 @@
+const actual = jest.requireActual("@budibase/pro")
+const pro = {
+ ...actual,
+ features: {
+ ...actual.features,
+ isTriggerAutomationRunEnabled: () => {
+ return true
+ },
+ },
+}
+
+export = pro
diff --git a/packages/server/package.json b/packages/server/package.json
index a3d84c8d94..d06e2ff475 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -66,7 +66,7 @@
"cookies": "0.8.0",
"csvtojson": "2.0.10",
"curlconverter": "3.21.0",
- "dd-trace": "3.13.2",
+ "dd-trace": "5.0.0",
"dotenv": "8.2.0",
"form-data": "4.0.0",
"global-agent": "3.0.0",
diff --git a/packages/server/src/automations/actions.ts b/packages/server/src/automations/actions.ts
index 81cf4d8176..ac8a340e82 100644
--- a/packages/server/src/automations/actions.ts
+++ b/packages/server/src/automations/actions.ts
@@ -15,6 +15,7 @@ import * as delay from "./steps/delay"
import * as queryRow from "./steps/queryRows"
import * as loop from "./steps/loop"
import * as collect from "./steps/collect"
+import * as triggerAutomationRun from "./steps/triggerAutomationRun"
import env from "../environment"
import {
AutomationStepSchema,
@@ -41,6 +42,7 @@ const ACTION_IMPLS: Record<
FILTER: filter.run,
QUERY_ROWS: queryRow.run,
COLLECT: collect.run,
+ TRIGGER_AUTOMATION_RUN: triggerAutomationRun.run,
// these used to be lowercase step IDs, maintain for backwards compat
discord: discord.run,
slack: slack.run,
@@ -62,6 +64,7 @@ export const BUILTIN_ACTION_DEFINITIONS: Record =
QUERY_ROWS: queryRow.definition,
LOOP: loop.definition,
COLLECT: collect.definition,
+ TRIGGER_AUTOMATION_RUN: triggerAutomationRun.definition,
// these used to be lowercase step IDs, maintain for backwards compat
discord: discord.definition,
slack: slack.definition,
diff --git a/packages/server/src/automations/steps/filter.ts b/packages/server/src/automations/steps/filter.ts
index 3b000f8f29..6867809500 100644
--- a/packages/server/src/automations/steps/filter.ts
+++ b/packages/server/src/automations/steps/filter.ts
@@ -99,7 +99,7 @@ export async function run({ inputs }: AutomationStepInput) {
} else {
result = false
}
- return { success: true, result }
+ return { success: true, result, refValue: field, comparisonValue: value }
} catch (err) {
return { success: false, result: false }
}
diff --git a/packages/server/src/automations/steps/triggerAutomationRun.ts b/packages/server/src/automations/steps/triggerAutomationRun.ts
new file mode 100644
index 0000000000..cb6126ca01
--- /dev/null
+++ b/packages/server/src/automations/steps/triggerAutomationRun.ts
@@ -0,0 +1,90 @@
+import {
+ AutomationActionStepId,
+ AutomationStepSchema,
+ AutomationStepInput,
+ AutomationStepType,
+ AutomationIOType,
+ AutomationResults,
+ Automation,
+ AutomationCustomIOType,
+} from "@budibase/types"
+import * as triggers from "../triggers"
+import { db as dbCore, context } from "@budibase/backend-core"
+import { features } from "@budibase/pro"
+
+export const definition: AutomationStepSchema = {
+ name: "Trigger an automation",
+ tagline: "Triggers an automation synchronously",
+ icon: "Sync",
+ description: "Triggers an automation synchronously",
+ type: AutomationStepType.ACTION,
+ internal: true,
+ features: {},
+ stepId: AutomationActionStepId.TRIGGER_AUTOMATION_RUN,
+ inputs: {},
+ schema: {
+ inputs: {
+ properties: {
+ automation: {
+ type: AutomationIOType.OBJECT,
+ properties: {
+ automationId: {
+ type: AutomationIOType.STRING,
+ customType: AutomationCustomIOType.AUTOMATION,
+ },
+ },
+ customType: AutomationCustomIOType.AUTOMATION_FIELDS,
+ title: "automatioFields",
+ required: ["automationId"],
+ },
+ timeout: {
+ type: AutomationIOType.NUMBER,
+ title: "Timeout (ms)",
+ },
+ },
+ required: ["automationId"],
+ },
+ outputs: {
+ properties: {
+ success: {
+ type: AutomationIOType.BOOLEAN,
+ description: "Whether the automation was successful",
+ },
+ value: {
+ type: AutomationIOType.OBJECT,
+ description: "Automation Result",
+ },
+ },
+ required: ["success", "value"],
+ },
+ },
+}
+
+export async function run({ inputs }: AutomationStepInput) {
+ const { automationId, ...fieldParams } = inputs.automation
+
+ if (await features.isTriggerAutomationRunEnabled()) {
+ if (!inputs.automation.automationId) {
+ return {
+ success: false,
+ }
+ } else {
+ const db = context.getAppDB()
+ let automation = await db.get(inputs.automation.automationId)
+
+ const response: AutomationResults = await triggers.externalTrigger(
+ automation,
+ {
+ fields: { ...fieldParams },
+ timeout: inputs.timeout * 1000 || 120000,
+ },
+ { getResponses: true }
+ )
+
+ return {
+ success: true,
+ value: response.steps,
+ }
+ }
+ }
+}
diff --git a/packages/server/src/automations/tests/triggerAutomationRun.spec.ts b/packages/server/src/automations/tests/triggerAutomationRun.spec.ts
new file mode 100644
index 0000000000..f8cf647e79
--- /dev/null
+++ b/packages/server/src/automations/tests/triggerAutomationRun.spec.ts
@@ -0,0 +1,43 @@
+jest.spyOn(global.console, "error")
+
+import * as setup from "./utilities"
+import * as automation from "../index"
+import { serverLogAutomation } from "../../tests/utilities/structures"
+
+describe("Test triggering an automation from another automation", () => {
+ let config = setup.getConfig()
+
+ beforeAll(async () => {
+ await automation.init()
+ await config.init()
+ })
+
+ afterAll(async () => {
+ await automation.shutdown()
+ setup.afterAll()
+ })
+
+ it("should trigger an other server log automation", async () => {
+ let automation = serverLogAutomation()
+ let newAutomation = await config.createAutomation(automation)
+
+ const inputs: any = {
+ automation: { automationId: newAutomation._id, timeout: 12000 },
+ }
+ const res = await setup.runStep(
+ setup.actions.TRIGGER_AUTOMATION_RUN.stepId,
+ inputs
+ )
+ // Check if the SERVER_LOG step was successful
+ expect(res.value[1].outputs.success).toBe(true)
+ })
+
+ it("should fail gracefully if the automation id is incorrect", async () => {
+ const inputs: any = { automation: { automationId: null, timeout: 12000 } }
+ const res = await setup.runStep(
+ setup.actions.TRIGGER_AUTOMATION_RUN.stepId,
+ inputs
+ )
+ expect(res.success).toBe(false)
+ })
+})
diff --git a/packages/server/src/tests/utilities/structures.ts b/packages/server/src/tests/utilities/structures.ts
index 83be8b6d58..80aad3c1e2 100644
--- a/packages/server/src/tests/utilities/structures.ts
+++ b/packages/server/src/tests/utilities/structures.ts
@@ -21,6 +21,7 @@ import {
Table,
INTERNAL_TABLE_SOURCE_ID,
TableSourceType,
+ AutomationIOType,
} from "@budibase/types"
const { BUILTIN_ROLE_IDS } = roles
@@ -153,6 +154,56 @@ export function basicAutomation(appId?: string): Automation {
}
}
+export function serverLogAutomation(appId?: string): Automation {
+ return {
+ name: "My Automation",
+ screenId: "kasdkfldsafkl",
+ live: true,
+ uiTree: {},
+ definition: {
+ trigger: {
+ stepId: AutomationTriggerStepId.APP,
+ name: "test",
+ tagline: "test",
+ icon: "test",
+ description: "test",
+ type: AutomationStepType.TRIGGER,
+ id: "test",
+ inputs: {},
+ schema: {
+ inputs: {
+ properties: {},
+ },
+ outputs: {
+ properties: {},
+ },
+ },
+ },
+ steps: [
+ {
+ stepId: AutomationActionStepId.SERVER_LOG,
+ name: "Backend log",
+ tagline: "Console log a value in the backend",
+ icon: "Monitoring",
+ description: "Logs the given text to the server (using console.log)",
+ internal: true,
+ features: {
+ LOOPING: true,
+ },
+ inputs: {
+ text: "log statement",
+ },
+ schema: BUILTIN_ACTION_DEFINITIONS.SERVER_LOG.schema,
+ id: "y8lkZbeSe",
+ type: AutomationStepType.ACTION,
+ },
+ ],
+ },
+ type: "automation",
+ appId: appId!,
+ }
+}
+
export function loopAutomation(tableId: string, loopOpts?: any): Automation {
if (!loopOpts) {
loopOpts = {
diff --git a/packages/types/src/documents/app/automation.ts b/packages/types/src/documents/app/automation.ts
index 88ce5e9b9a..91a1a2ab68 100644
--- a/packages/types/src/documents/app/automation.ts
+++ b/packages/types/src/documents/app/automation.ts
@@ -28,6 +28,8 @@ export enum AutomationCustomIOType {
TRIGGER_SCHEMA = "triggerSchema",
CRON = "cron",
WEBHOOK_URL = "webhookUrl",
+ AUTOMATION = "automation",
+ AUTOMATION_FIELDS = "automationFields",
}
export enum AutomationTriggerStepId {
@@ -61,6 +63,7 @@ export enum AutomationActionStepId {
LOOP = "LOOP",
COLLECT = "COLLECT",
OPENAI = "OPENAI",
+ TRIGGER_AUTOMATION_RUN = "TRIGGER_AUTOMATION_RUN",
// these used to be lowercase step IDs, maintain for backwards compat
discord = "discord",
slack = "slack",
diff --git a/packages/types/src/sdk/licensing/feature.ts b/packages/types/src/sdk/licensing/feature.ts
index 732a4a6c77..a3f149d6da 100644
--- a/packages/types/src/sdk/licensing/feature.ts
+++ b/packages/types/src/sdk/licensing/feature.ts
@@ -9,6 +9,7 @@ export enum Feature {
BRANDING = "branding",
SCIM = "scim",
SYNC_AUTOMATIONS = "syncAutomations",
+ TRIGGER_AUTOMATION_RUN = "triggerAutomationRun",
APP_BUILDERS = "appBuilders",
OFFLINE = "offline",
EXPANDED_PUBLIC_API = "expandedPublicApi",
diff --git a/packages/worker/package.json b/packages/worker/package.json
index 14f2a62919..2e3200fda5 100644
--- a/packages/worker/package.json
+++ b/packages/worker/package.json
@@ -48,7 +48,7 @@
"bcrypt": "5.1.0",
"bcryptjs": "2.4.3",
"bull": "4.10.1",
- "dd-trace": "3.13.2",
+ "dd-trace": "5.0.0",
"dotenv": "8.6.0",
"global-agent": "3.0.0",
"ical-generator": "4.1.0",
diff --git a/yarn.lock b/yarn.lock
index 8be79621da..854db7a96a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2227,42 +2227,21 @@
enabled "2.0.x"
kuler "^2.0.0"
-"@datadog/native-appsec@2.0.0":
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-2.0.0.tgz#ad65ba19bfd68e6b6c6cf64bb8ef55d099af8edc"
- integrity sha512-XHARZ6MVgbnfOUO6/F3ZoZ7poXHJCNYFlgcyS2Xetuk9ITA5bfcooX2B2F7tReVB+RLJ+j8bsm0t55SyF04KDw==
+"@datadog/native-appsec@6.0.0":
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-6.0.0.tgz#da753f8566ec5180ad9e83014cb44984b4bc878e"
+ integrity sha512-e7vH5usFoqov7FraPcA99fe80t2/qm4Cmno1T3iBhYlhyO6HD01ArDsCZ/sUvNIUR1ujxtbr8Z9WRGJ0qQ/FDA==
dependencies:
node-gyp-build "^3.9.0"
-"@datadog/native-appsec@4.0.0":
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/@datadog/native-appsec/-/native-appsec-4.0.0.tgz#ee08138b987dec557eac3650a43a972dac85b6a6"
- integrity sha512-myTguXJ3VQHS2E1ylNsSF1avNpDmq5t+K4Q47wdzeakGc3sDIDDyEbvuFTujl9c9wBIkup94O1mZj5DR37ajzA==
- dependencies:
- node-gyp-build "^3.9.0"
-
-"@datadog/native-iast-rewriter@1.1.2":
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/@datadog/native-iast-rewriter/-/native-iast-rewriter-1.1.2.tgz#793cbf92d218ec80d645be0830023656b81018ea"
- integrity sha512-pigRfRtAjZjMjqIXyXb98S4aDnuHz/EmqpoxAajFZsNjBLM87YonwSY5zoBdCsOyA46ddKOJRoCQd5ZalpOFMQ==
- dependencies:
- node-gyp-build "^4.5.0"
-
-"@datadog/native-iast-rewriter@2.2.1":
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.2.1.tgz#3c74c5a8caa0b876e091e9c5a95256add0d73e1c"
- integrity sha512-DyZlE8gNa5AoOFNKGRJU4RYF/Y/tJzv4bIAMuVBbEnMA0xhiIYqpYQG8T3OKkALl3VSEeBMjYwuOR2fCrJ6gzA==
+"@datadog/native-iast-rewriter@2.2.2":
+ version "2.2.2"
+ resolved "https://registry.yarnpkg.com/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.2.2.tgz#3f7feaf6be1af4c83ad063065b8ed509bbaf11cb"
+ integrity sha512-13ZBhJpjZ/tiV6rYfyAf/ITye9cyd3x12M/2NKhD4Ivev4N4uKBREAjpArOtzKtPXZ5b6oXwVV4ofT1SHoYyzA==
dependencies:
lru-cache "^7.14.0"
node-gyp-build "^4.5.0"
-"@datadog/native-iast-taint-tracking@1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-1.1.0.tgz#8f7d0016157b32dbf5c01b15b8afb1c4286b4a18"
- integrity sha512-TOrngpt6Qh52zWFOz1CkFXw0g43rnuUziFBtIMUsOLGzSHr9wdnTnE6HAyuvKy3f3ecAoZESlMfilGRKP93hXQ==
- dependencies:
- node-gyp-build "^3.9.0"
-
"@datadog/native-iast-taint-tracking@1.6.4":
version "1.6.4"
resolved "https://registry.yarnpkg.com/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-1.6.4.tgz#16c21ad7c36a53420c0d3c5a3720731809cc7e98"
@@ -2270,13 +2249,6 @@
dependencies:
node-gyp-build "^3.9.0"
-"@datadog/native-metrics@^1.5.0":
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/@datadog/native-metrics/-/native-metrics-1.6.0.tgz#1c7958964460149911f6964c32b1a8692ee3ce8f"
- integrity sha512-+8jBzd0nlLV+ay3Vb87DLwz8JHAS817hRhSRQ6zxhud9TyvvcNTNN+VA2sb2fe5UK4aMDvj/sGVJjEtgr4RHew==
- dependencies:
- node-gyp-build "^3.9.0"
-
"@datadog/native-metrics@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@datadog/native-metrics/-/native-metrics-2.0.0.tgz#65bf03313ee419956361e097551db36173e85712"
@@ -2285,10 +2257,10 @@
node-addon-api "^6.1.0"
node-gyp-build "^3.9.0"
-"@datadog/pprof@4.0.1":
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-4.0.1.tgz#f8629ecb62646d90ed49b6252dd0583d8d5001d3"
- integrity sha512-TavqyiyQZOaUM9eQB07r8+K/T1CqKyOdsUGxpN79+BF+eOQBpTj/Cte6KdlhcUSKL3h5hSjC+vlgA7uW2qtVhA==
+"@datadog/pprof@5.0.0":
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-5.0.0.tgz#0c0aaf06def6d2bc4b2d353ec7b264dadbfbefab"
+ integrity sha512-vhNan4SBuNWLpexunDJQ+hNbRAgWdk2qy5Iyh7Nn94uSSHXigAJMAvu4jwMKKQKFfchtobOkWT8GQUWW3tgpFg==
dependencies:
delay "^5.0.0"
node-gyp-build "<4.0"
@@ -2296,20 +2268,6 @@
pprof-format "^2.0.7"
source-map "^0.7.4"
-"@datadog/pprof@^1.1.1":
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/@datadog/pprof/-/pprof-1.1.1.tgz#17e86035140523ac3a96f3662e5dd29822042d61"
- integrity sha512-5lYXUpikQhrJwzODtJ7aFM0oKmPccISnTCecuWhjxIj4/7UJv0DamkLak634bgEW+kiChgkKFDapHSesuXRDXQ==
- dependencies:
- delay "^5.0.0"
- findit2 "^2.2.3"
- node-gyp-build "^3.9.0"
- p-limit "^3.1.0"
- pify "^5.0.0"
- protobufjs "^7.0.0"
- source-map "^0.7.3"
- split "^1.0.1"
-
"@datadog/sketches-js@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@datadog/sketches-js/-/sketches-js-2.1.0.tgz#8c7e8028a5fc22ad102fa542b0a446c956830455"
@@ -5599,9 +5557,9 @@
integrity sha512-7GgtHCs/QZrBrDzgIJnQtuSvhFSwhyYSI2uafSwZoNt1iOGhEN5fwNrQMjtONyHm9+/LoA4453jH0CMYcr06Pg==
"@types/node@>=8.1.0":
- version "20.11.1"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.1.tgz#6a93f94abeda166f688d3d2aca18012afbe5f850"
- integrity sha512-DsXojJUES2M+FE8CpptJTKpg+r54moV9ZEncPstni1WHFmTcCzeFLnMFfyhCVS8XNOy/OQG+8lVxRLRrVHmV5A==
+ version "20.11.2"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.2.tgz#39cea3fe02fbbc2f80ed283e94e1d24f2d3856fb"
+ integrity sha512-cZShBaVa+UO1LjWWBPmWRR4+/eY/JR/UIEcDlVsw3okjWEu+rB7/mH6X3B/L+qJVHDLjk9QW/y2upp9wp1yDXA==
dependencies:
undici-types "~5.26.4"
@@ -8845,62 +8803,29 @@ dc-polyfill@^0.1.2:
resolved "https://registry.yarnpkg.com/dc-polyfill/-/dc-polyfill-0.1.3.tgz#fe9eefc86813439dd46d6f9ad9582ec079c39720"
integrity sha512-Wyk5n/5KUj3GfVKV2jtDbtChC/Ff9fjKsBcg4ZtYW1yQe3DXNHcGURvmoxhqQdfOQ9TwyMjnfyv1lyYcOkFkFA==
-dd-trace@3.13.2:
- version "3.13.2"
- resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-3.13.2.tgz#95b1ec480ab9ac406e1da7591a8c6f678d3799fd"
- integrity sha512-POO9nEcAufe5pgp2xV1X3PfWip6wh+6TpEcRSlSgZJCIIMvWVCkcIVL/J2a6KAZq6V3Yjbkl8Ktfe+MOzQf5kw==
+dd-trace@5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-5.0.0.tgz#1e9848d6b6212ca67f8a3d62ce1f9ecd93fb5ebb"
+ integrity sha512-MmbM05l0qFeM73kDyyQAHWvyeZl2m6FYlv3hgtBU8GSpFmNu/33llyYp4TDpoEJ7hqd5LWT7mKKQFq8lRbTH3w==
dependencies:
- "@datadog/native-appsec" "2.0.0"
- "@datadog/native-iast-rewriter" "1.1.2"
- "@datadog/native-iast-taint-tracking" "1.1.0"
- "@datadog/native-metrics" "^1.5.0"
- "@datadog/pprof" "^1.1.1"
- "@datadog/sketches-js" "^2.1.0"
- crypto-randomuuid "^1.0.0"
- diagnostics_channel "^1.1.0"
- ignore "^5.2.0"
- import-in-the-middle "^1.3.4"
- ipaddr.js "^2.0.1"
- istanbul-lib-coverage "3.2.0"
- koalas "^1.0.2"
- limiter "^1.1.4"
- lodash.kebabcase "^4.1.1"
- lodash.pick "^4.4.0"
- lodash.sortby "^4.7.0"
- lodash.uniq "^4.5.0"
- lru-cache "^7.14.0"
- methods "^1.1.2"
- module-details-from-path "^1.0.3"
- node-abort-controller "^3.0.1"
- opentracing ">=0.12.1"
- path-to-regexp "^0.1.2"
- protobufjs "^7.1.2"
- retry "^0.10.1"
- semver "^5.5.0"
-
-dd-trace@4.20.0:
- version "4.20.0"
- resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-4.20.0.tgz#9a2cc3f28ff558c5605927b1362eb64605df76c1"
- integrity sha512-y7IDLSSt6nww6zMdw/I8oLdfgOQADIOkERCNdfSzlBrXHz5CHimEOFfsHN87ag0mn6vusr06aoi+CQRZSNJz2g==
- dependencies:
- "@datadog/native-appsec" "4.0.0"
- "@datadog/native-iast-rewriter" "2.2.1"
+ "@datadog/native-appsec" "6.0.0"
+ "@datadog/native-iast-rewriter" "2.2.2"
"@datadog/native-iast-taint-tracking" "1.6.4"
"@datadog/native-metrics" "^2.0.0"
- "@datadog/pprof" "4.0.1"
+ "@datadog/pprof" "5.0.0"
"@datadog/sketches-js" "^2.1.0"
"@opentelemetry/api" "^1.0.0"
"@opentelemetry/core" "^1.14.0"
crypto-randomuuid "^1.0.0"
dc-polyfill "^0.1.2"
ignore "^5.2.4"
- import-in-the-middle "^1.4.2"
+ import-in-the-middle "^1.7.1"
int64-buffer "^0.1.9"
ipaddr.js "^2.1.0"
istanbul-lib-coverage "3.2.0"
jest-docblock "^29.7.0"
koalas "^1.0.2"
- limiter "^1.1.4"
+ limiter "1.1.5"
lodash.kebabcase "^4.1.1"
lodash.pick "^4.4.0"
lodash.sortby "^4.7.0"
@@ -8913,9 +8838,10 @@ dd-trace@4.20.0:
opentracing ">=0.12.1"
path-to-regexp "^0.1.2"
pprof-format "^2.0.7"
- protobufjs "^7.2.4"
+ protobufjs "^7.2.5"
retry "^0.13.1"
semver "^7.5.4"
+ tlhunter-sorted-set "^0.1.0"
debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2:
version "4.3.4"
@@ -9391,11 +9317,6 @@ dezalgo@^1.0.4:
asap "^2.0.0"
wrappy "1"
-diagnostics_channel@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/diagnostics_channel/-/diagnostics_channel-1.1.0.tgz#bd66c49124ce3bac697dff57466464487f57cea5"
- integrity sha512-OE1ngLDjSBPG6Tx0YATELzYzy3RKHC+7veQ8gLa8yS7AAgw65mFbVdcsu3501abqOZCEZqZyAIemB0zXlqDSuw==
-
diff-match-patch@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.5.tgz#abb584d5f10cd1196dfc55aa03701592ae3f7b37"
@@ -10864,11 +10785,6 @@ find-up@^5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"
-findit2@^2.2.3:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/findit2/-/findit2-2.2.3.tgz#58a466697df8a6205cdfdbf395536b8bd777a5f6"
- integrity sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==
-
flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
@@ -12261,7 +12177,7 @@ import-from@^3.0.0:
dependencies:
resolve-from "^5.0.0"
-import-in-the-middle@^1.3.4, import-in-the-middle@^1.4.2:
+import-in-the-middle@^1.7.1:
version "1.7.2"
resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.7.2.tgz#31c44088271b50ecb9cacbdfb1e5732c802e0658"
integrity sha512-coz7AjRnPyKW36J6JX5Bjz1mcX7MX1H2XsEGseVcnXMdzsAbbAu0HBZhiAem+3SAmuZdi+p8OwoB2qUpTRgjOQ==
@@ -12475,7 +12391,7 @@ ip@^2.0.0:
resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da"
integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==
-ipaddr.js@^2.0.1, ipaddr.js@^2.1.0:
+ipaddr.js@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f"
integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==
@@ -14479,7 +14395,7 @@ lilconfig@^2.0.3, lilconfig@^2.0.5:
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==
-limiter@^1.1.4:
+limiter@1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2"
integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==
@@ -17556,9 +17472,9 @@ postgres-interval@^1.1.0:
xtend "^4.0.0"
posthog-js@^1.13.4:
- version "1.98.2"
- resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.98.2.tgz#d65032beadb099969b007cfaa2d6fbf7ea3687bf"
- integrity sha512-u0N98I81UV/lTQWBbjdqCcacbhPZHmApc8CNsvk1y9/iqHPShoKcbjRvAjtAw5ujD8kiX1GdrmxN3i6erxJBVg==
+ version "1.100.0"
+ resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.100.0.tgz#687b9a6e4ed226aa6572f4040b418ea0c8b3d353"
+ integrity sha512-r2XZEiHQ9mBK7D1G9k57I8uYZ2kZTAJ0OCX6K/OOdCWN8jKPhw3h5F9No5weilP6eVAn+hrsy7NvPV7SCX7gMg==
dependencies:
fflate "^0.4.1"
@@ -18067,7 +17983,7 @@ protobufjs@7.2.4:
"@types/node" ">=13.7.0"
long "^5.0.0"
-protobufjs@^7.0.0, protobufjs@^7.1.2, protobufjs@^7.2.4, protobufjs@^7.2.5:
+protobufjs@^7.0.0, protobufjs@^7.2.4, protobufjs@^7.2.5:
version "7.2.5"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.5.tgz#45d5c57387a6d29a17aab6846dcc283f9b8e7f2d"
integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==
@@ -18786,7 +18702,7 @@ retry@0.13.1, retry@^0.13.1:
resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658"
integrity "sha1-GFsVh6z2eRnWOzVzSeA1N7JIRlg= sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="
-retry@^0.10.0, retry@^0.10.1:
+retry@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
integrity sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==
@@ -19628,7 +19544,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
-source-map@^0.7.3, source-map@^0.7.4:
+source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
@@ -20659,6 +20575,11 @@ tinyspy@^1.0.2:
resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-1.1.1.tgz#0cb91d5157892af38cb2d217f5c7e8507a5bf092"
integrity sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==
+tlhunter-sorted-set@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/tlhunter-sorted-set/-/tlhunter-sorted-set-0.1.0.tgz#1c3eae28c0fa4dff97e9501d2e3c204b86406f4b"
+ integrity sha512-eGYW4bjf1DtrHzUYxYfAcSytpOkA44zsr7G2n3PV7yOUR23vmkGe3LL4R+1jL9OsXtbsFOwe8XtbCrabeaEFnw==
+
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"