more naming
This commit is contained in:
parent
394a8c4d94
commit
41051a8d69
|
@ -10,6 +10,7 @@ import {
|
|||
} 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",
|
||||
|
@ -62,26 +63,28 @@ export const definition: AutomationStepSchema = {
|
|||
export async function run({ inputs }: AutomationStepInput) {
|
||||
const { automationId, ...fieldParams } = inputs.automation
|
||||
|
||||
if (!inputs.automation.automationId) {
|
||||
return {
|
||||
success: false,
|
||||
}
|
||||
} else {
|
||||
const db = context.getAppDB()
|
||||
let automation = await db.get<Automation>(inputs.automation.automationId)
|
||||
if (await features.isTriggerAutomationRunEnabled()) {
|
||||
if (!inputs.automation.automationId) {
|
||||
return {
|
||||
success: false,
|
||||
}
|
||||
} else {
|
||||
const db = context.getAppDB()
|
||||
let automation = await db.get<Automation>(inputs.automation.automationId)
|
||||
|
||||
const response: AutomationResults = await triggers.externalTrigger(
|
||||
automation,
|
||||
{
|
||||
fields: { ...fieldParams },
|
||||
timeout: inputs.timeout * 1000 || 120000,
|
||||
},
|
||||
{ getResponses: true }
|
||||
)
|
||||
const response: AutomationResults = await triggers.externalTrigger(
|
||||
automation,
|
||||
{
|
||||
fields: { ...fieldParams },
|
||||
timeout: inputs.timeout * 1000 || 120000,
|
||||
},
|
||||
{ getResponses: true }
|
||||
)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
value: response.steps,
|
||||
return {
|
||||
success: true,
|
||||
value: response.steps,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue