> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # UpdateFunctionProduction # Package: functions # Namespace: FunctionProductions # Method link: https://dev.wix.com/docs/api-reference/business-management/functions/function-productions/update-function-production.md ## Permission Scopes: Manage Functions: SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS ## Introduction Updates a function production. --- ## REST API ### Schema ``` Method: updateFunctionProduction Description: Updates a function production. URL: https://www.wixapis.com/functions/v1/function-productions/{functionProduction.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: functionProduction, functionProduction.id, functionProduction.functionSpiConfiguration, functionProduction.automations Method parameters: param name: functionProduction | type: FunctionProduction | description: A function production defines a function and its related entities. | required: true - ONE-OF: - required: true - name: blankOptions | type: BlankOptions | description: Options for creating a function from a function type. - name: functionExtensionId | type: string | description: GUID of the function type that the function was created from. - name: templateOptions | type: TemplateOptions | description: Options for creating a function from a function template. - name: functionTemplateExtensionId | type: string | description: GUID of the function template that the function was created from. - name: id | type: string | description: Function production GUID. This is the same as the created function's GUID. | required: true - name: appId | type: string | description: App GUID of the business solution that created the function type the function production is based on. - name: type | type: Type | description: Type that the function is created from. - enum: - BLANK: Function created from a function type. - TEMPLATE: Function created from a function template. - name: functionSpiConfiguration | type: FunctionSpiConfiguration | description: Service plugin configuration for the function. | required: true - name: configuration | type: object | description: Function SPI configuration dev center component payload. - name: function | type: Function | description: Function created from the function production. - name: functionName | type: string | description: Function name. - name: automations | type: array | description: Automations created from the function production. | required: true - ONE-OF: - name: applicationInfo | type: ApplicationOrigin | description: When the origin of the automation is `APPLICATION`, the details of the app that created it. - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: preinstalledInfo | type: PreinstalledOrigin | description: When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. - name: appId | type: string | description: GUID of the app that added the [preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: templateInfo | type: TemplateOrigin | description: When the origin of the automation is `TEMPLATE`, the details of the template automation. - name: appId | type: string | description: GUID of the app that added the template automation. - name: name | type: string | description: Automation name as displayed on the user's site. - name: description | type: string | description: Automation description. - name: configuration | type: AutomationConfiguration | description: Automation configuration. - name: status | type: Status | description: Status of the automation on the site. - enum: - ACTIVE: Active. Active automations can be triggered. - INACTIVE: Inactive. Inactive automations cannot be triggered. - name: trigger | type: Trigger | description: Trigger configuration. - name: appId | type: string | description: GUID of the app that defines the trigger. - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/rest/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: filters | type: array | description: Schema field filters. All filter conditions must be met for the automation to run. Learn more about setting up [automation filters](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#filters). - name: id | type: string | description: Filter GUID. - name: fieldKey | type: string | description: Field key. You can find the field key in [the trigger payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema.md). - name: filterExpression | type: string | description: Filter expression in bracket notation. For the automation to run, the expression must evaluate to `true`. - name: scheduledEventOffset | type: FutureDateActivationOffset | description: Automation offset. You can schedule automations to run before the trigger occurs. Learn more about [scheduled events](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#scheduled-events). - name: preScheduledEventOffsetExpression | type: string | description: Amount of time before the trigger to run the automation. > **Note**: To delay an automation after the trigger event occurs, use a [delay action](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#delay-action). - name: scheduledEventOffsetTimeUnit | type: TimeUnit | description: Unit in which to set the action offset. - enum: - MINUTES: Minutes. - HOURS: Hours. - DAYS: Days. - WEEKS: Weeks. - MONTHS: Months. - name: rateLimit | type: RateLimit | description: Limit on the number of times an automation can be triggered. - name: maxActivationsExpression | type: string | description: Maximum number of times the trigger can be activated. - name: durationExpression | type: string | description: Duration of the rate limit. The rate limit applies for the specified duration and then expires. When empty, the rate limit does not expire. - name: durationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Activation identifier used to count the number of activations. - name: overrideSchema | type: object | description: Trigger schema override. When specified, this replaces the trigger schema. - name: rootActionIds | type: array | description: Root action GUIDs. A root action is the first action that runs after the trigger occurs. Root actions run in parallel. > **Note**: You can currently only specify 1 root action. - name: actions | type: Map | description: Actions the automation can execute, as `key:value` pairs. For the key, specify the action GUID. The value must be an object structured as described below. - ONE-OF: - name: appDefinedInfo | type: AppDefinedAction | description: Details of the action whose `type` is `APP_DEFINED`. - name: appId | type: string | description: GUID of the app that defines the action. - name: actionKey | type: string | description: Action key. - name: inputMapping | type: object | description: Action input mapping as defined in the action's [input schema](https://dev.wix.com/docs/rest/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. - name: postActionIds | type: array | description: IDs of actions that run in parallel after the action completes. - name: overrideOutputSchema | type: object | description: Action output schema. When specified, this replaces the action schema. - name: conditionInfo | type: ConditionAction | description: Details of the action whose `type` is `CONDITION`. - name: orExpressionGroups | type: array | description: Condition is `true` if one or more of the expression groups evaluates to `true`. - name: operator | type: Operator | description: Logical operator used to evaluate the condition expressions. - enum: - OR: `OR` operator. - AND: `AND` operator. - name: booleanExpressions | type: array | description: Expressions evaluated using the selected operator. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: codeConditionInfo | type: CodeConditionAction | description: Details of the action whose `type` is `CODE_CONDITION`. - name: snippet | type: CodeSnippet | description: condition code. This is a code that can be used to identify the condition in the automation. code should return a boolean value. otherwise the value will be tried to be casted to boolean. - name: language | type: Language | description: Logical operator used to evaluate the condition expressions. - enum: - JAVASCRIPT: JavaScript. - name: code | type: string | description: Expressions evaluated using the selected operator. this code should comply the language syntax. and format - name: dynamicVariableExpressions | type: array | description: dynamic variables used in the code snippet. these variables can be used inside the code using var('variableName') function. this list is mainly for validation purpose. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: delayInfo | type: DelayAction | description: Details of the action whose `type` is `DELAY`. - name: offsetExpression | type: string | description: Time to wait before running the action. The wait time starts from when the current action completes. > **Note**: To define the wait time from a specific moment in time, use `dueDateExpression`. - name: offsetTimeUnit | type: TimeUnit | description: Unit in which to set the wait time to wait before the action runs. - name: dueDateExpression | type: string | description: Action run date as a timestamp or DateTime expression using bracket notation. > **Note**: If an `offsetExpression` is defined, the delay is calculated from the time of the offset. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the time delay. - name: rateLimitInfo | type: RateLimitAction | description: Details of the action whose `type` is `RATE_LIMIT`. - name: maxActivationsExpression | type: string | description: Maximum number of times the action can run. - name: rateLimitDurationExpression | type: string | description: Rate limit duration. When empty, the rate limit does not expire. - name: rateLimitDurationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Unique identifier of each activation by which rate limiter counts activations. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the action completes. - name: id | type: string | description: Action GUID. Unique identifier for the action instance in the current automation. Use this to refer to this action in the automation flow. If not specified, automatically generated by Wix. - name: type | type: Type | description: [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#action-type). - enum: - APP_DEFINED: Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#app-defined-action). This action type is available in the site dashboard. - CONDITION: Condition action. Evaluates a condition to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `conditionInfo.truePostActionIds` run and those in `conditionInfo.falsePostActionIds` are skipped. - CODE_CONDITION: Code condition action. Evaluates custom code to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `codeConditionInfo.truePostActionIds` run and those in `codeConditionInfo.falsePostActionIds` are skipped. - DELAY: Delay. The automation must wait before executing the next step. - RATE_LIMIT: Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. - name: displayName | type: string | description: Editable display name for the action. - name: namespace | type: string | description: [Action namespace](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#namespace). This differentiates it from other actions of the same type. If the action outputs any data, the data appears under the namespace in the payload sent to the subsequent steps in the automation. If the user has multiple actions with the same `appId` and `actionKey`, the output of the previous action is overwritten. - name: skipActionExpression | type: string | description: Evaluated to determine whether the action is skipped. When evaluated to `true`, the action is skipped. Otherwise, the action runs. When empty, the action runs. - name: origin | type: Origin | description: How the automation was added to the user's site. - enum: - USER: Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-user). - APPLICATION: Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-app) for a particular site. - PREINSTALLED: [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: settings | type: AutomationSettings | description: Automation settings. Applied only for pre-installed and application automations. Not applied to User origin automations - name: hidden | type: boolean | description: Whether the automation is hidden from users. Default: `false` - name: readonly | type: boolean | description: Whether the automation is read-only. When `true`, site owners can't modify the automation or any of its actions. When `false`, users can configure specific actions as skippable or read-only using `settings.actionSettings`. Default: `false`. > **Note**: Setting `readOnly` to `true` overrides `settings.actionSettings`. - name: disableDelete | type: boolean | description: Whether to disable the option to delete the automation from the site. Default: `false`. - name: disableStatusChange | type: boolean | description: Whether to disable the option to change the automation's `configuration.status`. Default: `false`. - name: actionSettings | type: ActionSettings | description: Automation action settings. - name: permanentActionIds | type: array | description: IDs of actions whose `skipActionExpression` can't be modified. An action's `skipActionExpression` determines whether the action is skipped. Including an action's GUID in this array makes its `skipActionExpression` permanent, so it can't be changed. When empty, the `skipActionExpression` of all actions can be edited. - name: readonlyActionIds | type: array | description: IDs of read-only actions. Read-only actions cannot be modified. When empty and the automation's `settings.readonly` is `false`, all actions are modifiable. - name: archived | type: boolean | description: Whether the automation is archived. To archive an automation, set this to `true`. To restore an archived automation, set this to `false`. - name: autoArchivePolicy | type: AutoArchivePolicy | description: Auto archive policy - name: archiveDate | type: string | description: Date when to archive the automation If this date in the past, nothing will happen (automation will not go into archived state) If this date in the future, on this date the automation will be updated with archived = true and configuration.status = INACTIVE After this date the automation may be unarchived and archived again, this date will have no influence Return type: UpdateFunctionProductionResponse - name: functionProduction | type: FunctionProduction | description: Updated function production. - ONE-OF: - name: blankOptions | type: BlankOptions | description: Options for creating a function from a function type. - name: functionExtensionId | type: string | description: GUID of the function type that the function was created from. - name: templateOptions | type: TemplateOptions | description: Options for creating a function from a function template. - name: functionTemplateExtensionId | type: string | description: GUID of the function template that the function was created from. - name: id | type: string | description: Function production GUID. This is the same as the created function's GUID. - name: appId | type: string | description: App GUID of the business solution that created the function type the function production is based on. - name: type | type: Type | description: Type that the function is created from. - enum: - BLANK: Function created from a function type. - TEMPLATE: Function created from a function template. - name: functionSpiConfiguration | type: FunctionSpiConfiguration | description: Service plugin configuration for the function. - name: id | type: string | description: SpiConfiguration GUID. - name: revision | type: string | description: SpiConfiguration revision. - name: createdDate | type: string | description: Date and time the SpiConfiguration was created. - name: updatedDate | type: string | description: Date and time the SpiConfiguration was last updated. - name: functionId | type: string | description: Function GUID - name: configuration | type: object | description: Function SPI configuration dev center component payload. - name: function | type: Function | description: Function created from the function production. - name: id | type: string | description: Function GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the function is updated. To prevent conflicting changes, the current revision must be passed when updating the function. Ignored when creating a function. - name: createdDate | type: string | description: Date and time the function was created. - name: updatedDate | type: string | description: Date and time the function was last updated. - name: functionExtensionId | type: string | description: The function's app extension GUID. - name: functionName | type: string | description: Function name. - name: activationStatus | type: ActivationStatus | description: Activation status - enum: - ACTIVE: Function is activated. - INACTIVE: Function is deactivated. - DRAFT: Function is saved but has never been activated. - name: appId | type: string | description: GUID of the app that defines the function. - name: functionExtensionName | type: string | description: The function's app extension name. - name: functionTemplateExtensionId | type: string | description: Function template extension id - name: functionMethods | type: array | description: Function methods created from the function production. - name: id | type: string | description: Function method GUID. - name: revision | type: string | description: Function method revision. - name: createdDate | type: string | description: Date and time the function method was created. - name: updatedDate | type: string | description: Date and time the function method was last updated. - name: automationId | type: string | description: GUID of the automation to link to the function. - name: functionId | type: string | description: GUID of the function that this method links to an automation. - name: methodName | type: string | description: Display name for the function method. - name: automations | type: array | description: Automations created from the function production. - ONE-OF: - name: applicationInfo | type: ApplicationOrigin | description: When the origin of the automation is `APPLICATION`, the details of the app that created it. - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: preinstalledInfo | type: PreinstalledOrigin | description: When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. - name: appId | type: string | description: GUID of the app that added the [preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: override | type: boolean | description: Whether the automation is an override. When a user modifies the preinstalled automation installed on their site, a site-specific version of the automation is created that overrides the automation that was originally installed. This override automation has the same automation GUID as the original preinstalled automation. > **Note**: An override automation can no longer be updated by the app that originally installed it. > > To revert to the original preinstalled version, the user must delete the override by calling the Delete Automation method. Calling Delete Automation on an override automation removes the override method and restores the preinstalled automation that was previously installed. Default: `false`. - name: templateInfo | type: TemplateOrigin | description: When the origin of the automation is `TEMPLATE`, the details of the template automation. - name: appId | type: string | description: GUID of the app that added the template automation. - name: id | type: string | description: Automation GUID. - name: revision | type: string | description: Revision number. This increments by 1 whenever the automation is updated. Specify the current revision number whenever updating an existing automation. - name: createdBy | type: AuditInfo | description: Who created the automation. - ONE-OF: - name: userId | type: string | description: [User GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#user-id). - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: createdDate | type: string | description: When the automation was created. - name: updatedBy | type: AuditInfo | description: Who last updated the automation. - name: updatedDate | type: string | description: When the automation was last updated. - name: name | type: string | description: Automation name as displayed on the user's site. - name: description | type: string | description: Automation description. - name: configuration | type: AutomationConfiguration | description: Automation configuration. - name: status | type: Status | description: Status of the automation on the site. - enum: - ACTIVE: Active. Active automations can be triggered. - INACTIVE: Inactive. Inactive automations cannot be triggered. - name: trigger | type: Trigger | description: Trigger configuration. - name: appId | type: string | description: GUID of the app that defines the trigger. - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/rest/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: filters | type: array | description: Schema field filters. All filter conditions must be met for the automation to run. Learn more about setting up [automation filters](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#filters). - name: id | type: string | description: Filter GUID. - name: fieldKey | type: string | description: Field key. You can find the field key in [the trigger payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema.md). - name: filterExpression | type: string | description: Filter expression in bracket notation. For the automation to run, the expression must evaluate to `true`. - name: scheduledEventOffset | type: FutureDateActivationOffset | description: Automation offset. You can schedule automations to run before the trigger occurs. Learn more about [scheduled events](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#scheduled-events). - name: preScheduledEventOffsetExpression | type: string | description: Amount of time before the trigger to run the automation. > **Note**: To delay an automation after the trigger event occurs, use a [delay action](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#delay-action). - name: scheduledEventOffsetTimeUnit | type: TimeUnit | description: Unit in which to set the action offset. - enum: - MINUTES: Minutes. - HOURS: Hours. - DAYS: Days. - WEEKS: Weeks. - MONTHS: Months. - name: rateLimit | type: RateLimit | description: Limit on the number of times an automation can be triggered. - name: maxActivationsExpression | type: string | description: Maximum number of times the trigger can be activated. - name: durationExpression | type: string | description: Duration of the rate limit. The rate limit applies for the specified duration and then expires. When empty, the rate limit does not expire. - name: durationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Activation identifier used to count the number of activations. - name: overrideSchema | type: object | description: Trigger schema override. When specified, this replaces the trigger schema. - name: rootActionIds | type: array | description: Root action GUIDs. A root action is the first action that runs after the trigger occurs. Root actions run in parallel. > **Note**: You can currently only specify 1 root action. - name: actions | type: Map | description: Actions the automation can execute, as `key:value` pairs. For the key, specify the action GUID. The value must be an object structured as described below. - ONE-OF: - name: appDefinedInfo | type: AppDefinedAction | description: Details of the action whose `type` is `APP_DEFINED`. - name: appId | type: string | description: GUID of the app that defines the action. - name: actionKey | type: string | description: Action key. - name: inputMapping | type: object | description: Action input mapping as defined in the action's [input schema](https://dev.wix.com/docs/rest/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. - name: postActionIds | type: array | description: IDs of actions that run in parallel after the action completes. - name: overrideOutputSchema | type: object | description: Action output schema. When specified, this replaces the action schema. - name: conditionInfo | type: ConditionAction | description: Details of the action whose `type` is `CONDITION`. - name: orExpressionGroups | type: array | description: Condition is `true` if one or more of the expression groups evaluates to `true`. - name: operator | type: Operator | description: Logical operator used to evaluate the condition expressions. - enum: - OR: `OR` operator. - AND: `AND` operator. - name: booleanExpressions | type: array | description: Expressions evaluated using the selected operator. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: codeConditionInfo | type: CodeConditionAction | description: Details of the action whose `type` is `CODE_CONDITION`. - name: snippet | type: CodeSnippet | description: condition code. This is a code that can be used to identify the condition in the automation. code should return a boolean value. otherwise the value will be tried to be casted to boolean. - name: language | type: Language | description: Logical operator used to evaluate the condition expressions. - enum: - JAVASCRIPT: JavaScript. - name: code | type: string | description: Expressions evaluated using the selected operator. this code should comply the language syntax. and format - name: dynamicVariableExpressions | type: array | description: dynamic variables used in the code snippet. these variables can be used inside the code using var('variableName') function. this list is mainly for validation purpose. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: delayInfo | type: DelayAction | description: Details of the action whose `type` is `DELAY`. - name: offsetExpression | type: string | description: Time to wait before running the action. The wait time starts from when the current action completes. > **Note**: To define the wait time from a specific moment in time, use `dueDateExpression`. - name: offsetTimeUnit | type: TimeUnit | description: Unit in which to set the wait time to wait before the action runs. - name: dueDateExpression | type: string | description: Action run date as a timestamp or DateTime expression using bracket notation. > **Note**: If an `offsetExpression` is defined, the delay is calculated from the time of the offset. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the time delay. - name: rateLimitInfo | type: RateLimitAction | description: Details of the action whose `type` is `RATE_LIMIT`. - name: maxActivationsExpression | type: string | description: Maximum number of times the action can run. - name: rateLimitDurationExpression | type: string | description: Rate limit duration. When empty, the rate limit does not expire. - name: rateLimitDurationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Unique identifier of each activation by which rate limiter counts activations. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the action completes. - name: id | type: string | description: Action GUID. Unique identifier for the action instance in the current automation. Use this to refer to this action in the automation flow. If not specified, automatically generated by Wix. - name: type | type: Type | description: [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#action-type). - enum: - APP_DEFINED: Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#app-defined-action). This action type is available in the site dashboard. - CONDITION: Condition action. Evaluates a condition to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `conditionInfo.truePostActionIds` run and those in `conditionInfo.falsePostActionIds` are skipped. - CODE_CONDITION: Code condition action. Evaluates custom code to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `codeConditionInfo.truePostActionIds` run and those in `codeConditionInfo.falsePostActionIds` are skipped. - DELAY: Delay. The automation must wait before executing the next step. - RATE_LIMIT: Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. - name: displayName | type: string | description: Editable display name for the action. - name: namespace | type: string | description: [Action namespace](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#namespace). This differentiates it from other actions of the same type. If the action outputs any data, the data appears under the namespace in the payload sent to the subsequent steps in the automation. If the user has multiple actions with the same `appId` and `actionKey`, the output of the previous action is overwritten. - name: skipActionExpression | type: string | description: Evaluated to determine whether the action is skipped. When evaluated to `true`, the action is skipped. Otherwise, the action runs. When empty, the action runs. - name: origin | type: Origin | description: How the automation was added to the user's site. - enum: - USER: Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-user). - APPLICATION: Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-app) for a particular site. - PREINSTALLED: [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: settings | type: AutomationSettings | description: Automation settings. Applied only for pre-installed and application automations. Not applied to User origin automations - name: hidden | type: boolean | description: Whether the automation is hidden from users. Default: `false` - name: readonly | type: boolean | description: Whether the automation is read-only. When `true`, site owners can't modify the automation or any of its actions. When `false`, users can configure specific actions as skippable or read-only using `settings.actionSettings`. Default: `false`. > **Note**: Setting `readOnly` to `true` overrides `settings.actionSettings`. - name: disableDelete | type: boolean | description: Whether to disable the option to delete the automation from the site. Default: `false`. - name: disableStatusChange | type: boolean | description: Whether to disable the option to change the automation's `configuration.status`. Default: `false`. - name: actionSettings | type: ActionSettings | description: Automation action settings. - name: permanentActionIds | type: array | description: IDs of actions whose `skipActionExpression` can't be modified. An action's `skipActionExpression` determines whether the action is skipped. Including an action's GUID in this array makes its `skipActionExpression` permanent, so it can't be changed. When empty, the `skipActionExpression` of all actions can be edited. - name: readonlyActionIds | type: array | description: IDs of read-only actions. Read-only actions cannot be modified. When empty and the automation's `settings.readonly` is `false`, all actions are modifiable. - name: draftInfo | type: DraftInfo | description: When the automation is a draft, the draft details. - name: originalAutomationId | type: string | description: GUID of the original automation. - name: archived | type: boolean | description: Whether the automation is archived. To archive an automation, set this to `true`. To restore an archived automation, set this to `false`. - name: autoArchivePolicy | type: AutoArchivePolicy | description: Auto archive policy - name: archiveDate | type: string | description: Date when to archive the automation If this date in the past, nothing will happen (automation will not go into archived state) If this date in the future, on this date the automation will be updated with archived = true and configuration.status = INACTIVE After this date the automation may be unarchived and archived again, this date will have no influence - name: createdDate | type: string | description: Date and time the function production was created. - name: updatedDate | type: string | description: Date and time the function production was last updated. ``` ### Examples ### Update Function Production ```curl curl -X PATCH \ https://www.wixapis.com/functions/v1/productions/df00a45a-0db3-4a2e-a5c0-faeada87b1b4 \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' \ -d '{ "function_production": { "id": "df00a45a-0db3-4a2e-a5c0-faeada87b1b4", "function_spi_configuration": { "id": "512e15d8-0a3b-4580-a9ce-5761328b5088", "revision": "7", "created_date": "2025-09-15T12:35:27.454Z", "updated_date": "2025-10-01T12:36:49.692Z", "function_id": "df00a45a-0db3-4a2e-a5c0-faeada87b1b4", "configuration": { "rewardName": "Birthday reward", "rewardDescription": "Something" } }, "automations": [ { "id": "edeb4472-cfce-41b3-b99d-52902d63d802", "revision": "14", "created_by": { "user_id": "c4d433b3-b3c3-4c9b-9e1e-29b1f1a2b3c4" }, "updated_by": { "user_id": "c4d433b3-b3c3-4c9b-9e1e-29b1f1a2b3c4" }, "name": "Birthday treat func", "configuration": { "status": "ACTIVE", "trigger": { "app_id": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "trigger_key": "function_23d95ad4-6eba-5e06-888e-164c2b9c4f5f" }, "root_action_ids": [ "7f60bff6-329f-4321-a2b2-d4ef36dc02b1" ], "actions": { "42b8bfa9-abf6-485e-bc45-5bea415030bc": { "id": "42b8bfa9-abf6-485e-bc45-5bea415030bc", "type": "OUTPUT", "output_info": { "output_mapping": { "amount": "40", "costInPoints": 20 } } }, "7f60bff6-329f-4321-a2b2-d4ef36dc02b1": { "id": "7f60bff6-329f-4321-a2b2-d4ef36dc02b1", "type": "SET_VARIABLES", "namespace": "setVariable", "set_variables_info": { "output_mapping": { "5c23033c-006c-4aa1-a55f-dde4cda046d8": "{{month(now( ) )}}", "e168c63f-dd14-4a6b-a460-a080e042dd67": "{{month(var(\"contact.birthdate\") )}}" }, "output_schema": { "type": "object", "properties": { "e168c63f-dd14-4a6b-a460-a080e042dd67": { "type": "number", "title": "Customer birthday month" }, "5c23033c-006c-4aa1-a55f-dde4cda046d8": { "type": "number", "title": "Current month" } }, "required": [ "e168c63f-dd14-4a6b-a460-a080e042dd67", "5c23033c-006c-4aa1-a55f-dde4cda046d8" ] }, "post_action_ids": [ "afa749cb-bb2f-421c-aefc-7bd527fc36c0" ] } }, "afa749cb-bb2f-421c-aefc-7bd527fc36c0": { "id": "afa749cb-bb2f-421c-aefc-7bd527fc36c0", "type": "CONDITION", "namespace": "CONDITION-1", "condition_info": { "or_expression_groups": [ { "operator": "OR", "boolean_expressions": [ "numberEq(var(\\\"setVariable.e168c63f-dd14-4a6b-a460-a080e042dd67\\\");var(\\\"setVariable.5c23033c-006c-4aa1-a55f-dde4cda046d8\\\"))" ] } ], "true_post_action_ids": [ "42b8bfa9-abf6-485e-bc45-5bea415030bc" ] } } } }, "origin": "USER", "settings": { "hidden": true, "readonly": false, "disable_delete": false, "disable_status_change": false, "action_settings": { "disable_delay_addition": false, "disable_condition_addition": false }, "domain": "USER" }, "draft_info": {}, "namespace": "functions", "archived": false } ] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.functions.FunctionProductions.updateFunctionProduction(_id, functionProduction) Description: Updates a function production. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: functionProduction, _id, functionProduction.functionSpiConfiguration, functionProduction.automations Method parameters: param name: _id | type: string | description: Function production GUID. This is the same as the created function's GUID. | required: true param name: functionProduction | type: UpdateFunctionProduction | description: A function production defines a function and its related entities. | required: true - ONE-OF: - required: true - name: blankOptions | type: BlankOptions | description: Options for creating a function from a function type. - name: functionExtensionId | type: string | description: GUID of the function type that the function was created from. - name: templateOptions | type: TemplateOptions | description: Options for creating a function from a function template. - name: functionTemplateExtensionId | type: string | description: GUID of the function template that the function was created from. - name: appId | type: string | description: App GUID of the business solution that created the function type the function production is based on. - name: type | type: Type | description: Type that the function is created from. - enum: - BLANK: Function created from a function type. - TEMPLATE: Function created from a function template. - name: functionSpiConfiguration | type: FunctionSpiConfiguration | description: Service plugin configuration for the function. | required: true - name: configuration | type: object | description: Function SPI configuration dev center component payload. - name: function | type: Function | description: Function created from the function production. - name: functionName | type: string | description: Function name. - name: automations | type: array | description: Automations created from the function production. | required: true - ONE-OF: - name: applicationInfo | type: ApplicationOrigin | description: When the origin of the automation is `APPLICATION`, the details of the app that created it. - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: preinstalledInfo | type: PreinstalledOrigin | description: When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. - name: appId | type: string | description: GUID of the app that added the [preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: templateInfo | type: TemplateOrigin | description: When the origin of the automation is `TEMPLATE`, the details of the template automation. - name: appId | type: string | description: GUID of the app that added the template automation. - name: name | type: string | description: Automation name as displayed on the user's site. - name: description | type: string | description: Automation description. - name: configuration | type: AutomationConfiguration | description: Automation configuration. - name: status | type: Status | description: Status of the automation on the site. - enum: - ACTIVE: Active. Active automations can be triggered. - INACTIVE: Inactive. Inactive automations cannot be triggered. - name: trigger | type: Trigger | description: Trigger configuration. - name: appId | type: string | description: GUID of the app that defines the trigger. - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/rest/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: filters | type: array | description: Schema field filters. All filter conditions must be met for the automation to run. Learn more about setting up [automation filters](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#filters). - name: _id | type: string | description: Filter GUID. - name: fieldKey | type: string | description: Field key. You can find the field key in [the trigger payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema.md). - name: filterExpression | type: string | description: Filter expression in bracket notation. For the automation to run, the expression must evaluate to `true`. - name: scheduledEventOffset | type: FutureDateActivationOffset | description: Automation offset. You can schedule automations to run before the trigger occurs. Learn more about [scheduled events](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#scheduled-events). - name: preScheduledEventOffsetExpression | type: string | description: Amount of time before the trigger to run the automation. > **Note**: To delay an automation after the trigger event occurs, use a [delay action](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#delay-action). - name: scheduledEventOffsetTimeUnit | type: TimeUnit | description: Unit in which to set the action offset. - enum: - MINUTES: Minutes. - HOURS: Hours. - DAYS: Days. - WEEKS: Weeks. - MONTHS: Months. - name: rateLimit | type: RateLimit | description: Limit on the number of times an automation can be triggered. - name: maxActivationsExpression | type: string | description: Maximum number of times the trigger can be activated. - name: durationExpression | type: string | description: Duration of the rate limit. The rate limit applies for the specified duration and then expires. When empty, the rate limit does not expire. - name: durationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Activation identifier used to count the number of activations. - name: overrideSchema | type: object | description: Trigger schema override. When specified, this replaces the trigger schema. - name: rootActionIds | type: array | description: Root action GUIDs. A root action is the first action that runs after the trigger occurs. Root actions run in parallel. > **Note**: You can currently only specify 1 root action. - name: actions | type: Map | description: Actions the automation can execute, as `key:value` pairs. For the key, specify the action GUID. The value must be an object structured as described below. - ONE-OF: - name: appDefinedInfo | type: AppDefinedAction | description: Details of the action whose `type` is `APP_DEFINED`. - name: appId | type: string | description: GUID of the app that defines the action. - name: actionKey | type: string | description: Action key. - name: inputMapping | type: object | description: Action input mapping as defined in the action's [input schema](https://dev.wix.com/docs/rest/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. - name: postActionIds | type: array | description: IDs of actions that run in parallel after the action completes. - name: overrideOutputSchema | type: object | description: Action output schema. When specified, this replaces the action schema. - name: conditionInfo | type: ConditionAction | description: Details of the action whose `type` is `CONDITION`. - name: orExpressionGroups | type: array | description: Condition is `true` if one or more of the expression groups evaluates to `true`. - name: operator | type: Operator | description: Logical operator used to evaluate the condition expressions. - enum: - OR: `OR` operator. - AND: `AND` operator. - name: booleanExpressions | type: array | description: Expressions evaluated using the selected operator. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: codeConditionInfo | type: CodeConditionAction | description: Details of the action whose `type` is `CODE_CONDITION`. - name: snippet | type: CodeSnippet | description: condition code. This is a code that can be used to identify the condition in the automation. code should return a boolean value. otherwise the value will be tried to be casted to boolean. - name: language | type: Language | description: Logical operator used to evaluate the condition expressions. - enum: - JAVASCRIPT: JavaScript. - name: code | type: string | description: Expressions evaluated using the selected operator. this code should comply the language syntax. and format - name: dynamicVariableExpressions | type: array | description: dynamic variables used in the code snippet. these variables can be used inside the code using var('variableName') function. this list is mainly for validation purpose. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: delayInfo | type: DelayAction | description: Details of the action whose `type` is `DELAY`. - name: offsetExpression | type: string | description: Time to wait before running the action. The wait time starts from when the current action completes. > **Note**: To define the wait time from a specific moment in time, use `dueDateExpression`. - name: offsetTimeUnit | type: TimeUnit | description: Unit in which to set the wait time to wait before the action runs. - name: dueDateExpression | type: string | description: Action run date as a timestamp or DateTime expression using bracket notation. > **Note**: If an `offsetExpression` is defined, the delay is calculated from the time of the offset. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the time delay. - name: rateLimitInfo | type: RateLimitAction | description: Details of the action whose `type` is `RATE_LIMIT`. - name: maxActivationsExpression | type: string | description: Maximum number of times the action can run. - name: rateLimitDurationExpression | type: string | description: Rate limit duration. When empty, the rate limit does not expire. - name: rateLimitDurationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Unique identifier of each activation by which rate limiter counts activations. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the action completes. - name: _id | type: string | description: Action GUID. Unique identifier for the action instance in the current automation. Use this to refer to this action in the automation flow. If not specified, automatically generated by Wix. - name: type | type: Type | description: [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#action-type). - enum: - APP_DEFINED: Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#app-defined-action). This action type is available in the site dashboard. - CONDITION: Condition action. Evaluates a condition to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `conditionInfo.truePostActionIds` run and those in `conditionInfo.falsePostActionIds` are skipped. - CODE_CONDITION: Code condition action. Evaluates custom code to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `codeConditionInfo.truePostActionIds` run and those in `codeConditionInfo.falsePostActionIds` are skipped. - DELAY: Delay. The automation must wait before executing the next step. - RATE_LIMIT: Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. - name: displayName | type: string | description: Editable display name for the action. - name: namespace | type: string | description: [Action namespace](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#namespace). This differentiates it from other actions of the same type. If the action outputs any data, the data appears under the namespace in the payload sent to the subsequent steps in the automation. If the user has multiple actions with the same `appId` and `actionKey`, the output of the previous action is overwritten. - name: skipActionExpression | type: string | description: Evaluated to determine whether the action is skipped. When evaluated to `true`, the action is skipped. Otherwise, the action runs. When empty, the action runs. - name: origin | type: Origin | description: How the automation was added to the user's site. - enum: - USER: Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-user). - APPLICATION: Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-app) for a particular site. - PREINSTALLED: [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: settings | type: AutomationSettings | description: Automation settings. Applied only for pre-installed and application automations. Not applied to User origin automations - name: hidden | type: boolean | description: Whether the automation is hidden from users. Default: `false` - name: readonly | type: boolean | description: Whether the automation is read-only. When `true`, site owners can't modify the automation or any of its actions. When `false`, users can configure specific actions as skippable or read-only using `settings.actionSettings`. Default: `false`. > **Note**: Setting `readOnly` to `true` overrides `settings.actionSettings`. - name: disableDelete | type: boolean | description: Whether to disable the option to delete the automation from the site. Default: `false`. - name: disableStatusChange | type: boolean | description: Whether to disable the option to change the automation's `configuration.status`. Default: `false`. - name: actionSettings | type: ActionSettings | description: Automation action settings. - name: permanentActionIds | type: array | description: IDs of actions whose `skipActionExpression` can't be modified. An action's `skipActionExpression` determines whether the action is skipped. Including an action's GUID in this array makes its `skipActionExpression` permanent, so it can't be changed. When empty, the `skipActionExpression` of all actions can be edited. - name: readonlyActionIds | type: array | description: IDs of read-only actions. Read-only actions cannot be modified. When empty and the automation's `settings.readonly` is `false`, all actions are modifiable. - name: archived | type: boolean | description: Whether the automation is archived. To archive an automation, set this to `true`. To restore an archived automation, set this to `false`. - name: autoArchivePolicy | type: AutoArchivePolicy | description: Auto archive policy - name: archiveDate | type: Date | description: Date when to archive the automation If this date in the past, nothing will happen (automation will not go into archived state) If this date in the future, on this date the automation will be updated with archived = true and configuration.status = INACTIVE After this date the automation may be unarchived and archived again, this date will have no influence Return type: PROMISE - ONE-OF: - name: blankOptions | type: BlankOptions | description: Options for creating a function from a function type. - name: functionExtensionId | type: string | description: GUID of the function type that the function was created from. - name: templateOptions | type: TemplateOptions | description: Options for creating a function from a function template. - name: functionTemplateExtensionId | type: string | description: GUID of the function template that the function was created from. - name: _id | type: string | description: Function production GUID. This is the same as the created function's GUID. - name: appId | type: string | description: App GUID of the business solution that created the function type the function production is based on. - name: type | type: Type | description: Type that the function is created from. - enum: - BLANK: Function created from a function type. - TEMPLATE: Function created from a function template. - name: functionSpiConfiguration | type: FunctionSpiConfiguration | description: Service plugin configuration for the function. - name: _id | type: string | description: SpiConfiguration GUID. - name: revision | type: string | description: SpiConfiguration revision. - name: _createdDate | type: Date | description: Date and time the SpiConfiguration was created. - name: _updatedDate | type: Date | description: Date and time the SpiConfiguration was last updated. - name: functionId | type: string | description: Function GUID - name: configuration | type: object | description: Function SPI configuration dev center component payload. - name: function | type: Function | description: Function created from the function production. - name: _id | type: string | description: Function GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the function is updated. To prevent conflicting changes, the current revision must be passed when updating the function. Ignored when creating a function. - name: _createdDate | type: Date | description: Date and time the function was created. - name: _updatedDate | type: Date | description: Date and time the function was last updated. - name: functionExtensionId | type: string | description: The function's app extension GUID. - name: functionName | type: string | description: Function name. - name: activationStatus | type: ActivationStatus | description: Activation status - enum: - ACTIVE: Function is activated. - INACTIVE: Function is deactivated. - DRAFT: Function is saved but has never been activated. - name: appId | type: string | description: GUID of the app that defines the function. - name: functionExtensionName | type: string | description: The function's app extension name. - name: functionTemplateExtensionId | type: string | description: Function template extension id - name: functionMethods | type: array | description: Function methods created from the function production. - name: _id | type: string | description: Function method GUID. - name: revision | type: string | description: Function method revision. - name: _createdDate | type: Date | description: Date and time the function method was created. - name: _updatedDate | type: Date | description: Date and time the function method was last updated. - name: automationId | type: string | description: GUID of the automation to link to the function. - name: functionId | type: string | description: GUID of the function that this method links to an automation. - name: methodName | type: string | description: Display name for the function method. - name: automations | type: array | description: Automations created from the function production. - ONE-OF: - name: applicationInfo | type: ApplicationOrigin | description: When the origin of the automation is `APPLICATION`, the details of the app that created it. - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: preinstalledInfo | type: PreinstalledOrigin | description: When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. - name: appId | type: string | description: GUID of the app that added the [preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: override | type: boolean | description: Whether the automation is an override. When a user modifies the preinstalled automation installed on their site, a site-specific version of the automation is created that overrides the automation that was originally installed. This override automation has the same automation GUID as the original preinstalled automation. > **Note**: An override automation can no longer be updated by the app that originally installed it. > > To revert to the original preinstalled version, the user must delete the override by calling the Delete Automation method. Calling Delete Automation on an override automation removes the override method and restores the preinstalled automation that was previously installed. Default: `false`. - name: templateInfo | type: TemplateOrigin | description: When the origin of the automation is `TEMPLATE`, the details of the template automation. - name: appId | type: string | description: GUID of the app that added the template automation. - name: _id | type: string | description: Automation GUID. - name: revision | type: string | description: Revision number. This increments by 1 whenever the automation is updated. Specify the current revision number whenever updating an existing automation. - name: createdBy | type: AuditInfo | description: Who created the automation. - ONE-OF: - name: userId | type: string | description: [User GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#user-id). - name: appId | type: string | description: [App GUID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#app-id). You can find the app GUID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard. - name: _createdDate | type: Date | description: When the automation was created. - name: updatedBy | type: AuditInfo | description: Who last updated the automation. - name: _updatedDate | type: Date | description: When the automation was last updated. - name: name | type: string | description: Automation name as displayed on the user's site. - name: description | type: string | description: Automation description. - name: configuration | type: AutomationConfiguration | description: Automation configuration. - name: status | type: Status | description: Status of the automation on the site. - enum: - ACTIVE: Active. Active automations can be triggered. - INACTIVE: Inactive. Inactive automations cannot be triggered. - name: trigger | type: Trigger | description: Trigger configuration. - name: appId | type: string | description: GUID of the app that defines the trigger. - name: triggerKey | type: string | description: Trigger key. Learn about [setting up a trigger](https://dev.wix.com/docs/rest/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger). - name: filters | type: array | description: Schema field filters. All filter conditions must be met for the automation to run. Learn more about setting up [automation filters](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#filters). - name: _id | type: string | description: Filter GUID. - name: fieldKey | type: string | description: Field key. You can find the field key in [the trigger payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema.md). - name: filterExpression | type: string | description: Filter expression in bracket notation. For the automation to run, the expression must evaluate to `true`. - name: scheduledEventOffset | type: FutureDateActivationOffset | description: Automation offset. You can schedule automations to run before the trigger occurs. Learn more about [scheduled events](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#scheduled-events). - name: preScheduledEventOffsetExpression | type: string | description: Amount of time before the trigger to run the automation. > **Note**: To delay an automation after the trigger event occurs, use a [delay action](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#delay-action). - name: scheduledEventOffsetTimeUnit | type: TimeUnit | description: Unit in which to set the action offset. - enum: - MINUTES: Minutes. - HOURS: Hours. - DAYS: Days. - WEEKS: Weeks. - MONTHS: Months. - name: rateLimit | type: RateLimit | description: Limit on the number of times an automation can be triggered. - name: maxActivationsExpression | type: string | description: Maximum number of times the trigger can be activated. - name: durationExpression | type: string | description: Duration of the rate limit. The rate limit applies for the specified duration and then expires. When empty, the rate limit does not expire. - name: durationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Activation identifier used to count the number of activations. - name: overrideSchema | type: object | description: Trigger schema override. When specified, this replaces the trigger schema. - name: rootActionIds | type: array | description: Root action GUIDs. A root action is the first action that runs after the trigger occurs. Root actions run in parallel. > **Note**: You can currently only specify 1 root action. - name: actions | type: Map | description: Actions the automation can execute, as `key:value` pairs. For the key, specify the action GUID. The value must be an object structured as described below. - ONE-OF: - name: appDefinedInfo | type: AppDefinedAction | description: Details of the action whose `type` is `APP_DEFINED`. - name: appId | type: string | description: GUID of the app that defines the action. - name: actionKey | type: string | description: Action key. - name: inputMapping | type: object | description: Action input mapping as defined in the action's [input schema](https://dev.wix.com/docs/rest/business-management/automations/actions/the-action-input-schema.md). The input mapping must include all parameters specified in the action's input schema's `required` array, and can include any other parameters from the schema. - name: postActionIds | type: array | description: IDs of actions that run in parallel after the action completes. - name: overrideOutputSchema | type: object | description: Action output schema. When specified, this replaces the action schema. - name: conditionInfo | type: ConditionAction | description: Details of the action whose `type` is `CONDITION`. - name: orExpressionGroups | type: array | description: Condition is `true` if one or more of the expression groups evaluates to `true`. - name: operator | type: Operator | description: Logical operator used to evaluate the condition expressions. - enum: - OR: `OR` operator. - AND: `AND` operator. - name: booleanExpressions | type: array | description: Expressions evaluated using the selected operator. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: codeConditionInfo | type: CodeConditionAction | description: Details of the action whose `type` is `CODE_CONDITION`. - name: snippet | type: CodeSnippet | description: condition code. This is a code that can be used to identify the condition in the automation. code should return a boolean value. otherwise the value will be tried to be casted to boolean. - name: language | type: Language | description: Logical operator used to evaluate the condition expressions. - enum: - JAVASCRIPT: JavaScript. - name: code | type: string | description: Expressions evaluated using the selected operator. this code should comply the language syntax. and format - name: dynamicVariableExpressions | type: array | description: dynamic variables used in the code snippet. these variables can be used inside the code using var('variableName') function. this list is mainly for validation purpose. - name: truePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `true`. - name: falsePostActionIds | type: array | description: IDs of actions to run when the condition evaluates to `false`. - name: mergeActionId | type: string | description: GUID of the MERGE action for this condition. When absent, branches run independently (current behavior). - name: delayInfo | type: DelayAction | description: Details of the action whose `type` is `DELAY`. - name: offsetExpression | type: string | description: Time to wait before running the action. The wait time starts from when the current action completes. > **Note**: To define the wait time from a specific moment in time, use `dueDateExpression`. - name: offsetTimeUnit | type: TimeUnit | description: Unit in which to set the wait time to wait before the action runs. - name: dueDateExpression | type: string | description: Action run date as a timestamp or DateTime expression using bracket notation. > **Note**: If an `offsetExpression` is defined, the delay is calculated from the time of the offset. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the time delay. - name: rateLimitInfo | type: RateLimitAction | description: Details of the action whose `type` is `RATE_LIMIT`. - name: maxActivationsExpression | type: string | description: Maximum number of times the action can run. - name: rateLimitDurationExpression | type: string | description: Rate limit duration. When empty, the rate limit does not expire. - name: rateLimitDurationTimeUnit | type: TimeUnit | description: Unit in which to set the duration of the rate limit. - name: uniqueIdentifierExpression | type: string | description: Unique identifier of each activation by which rate limiter counts activations. - name: postActionIds | type: array | description: IDs of actions to run in parallel after the action completes. - name: _id | type: string | description: Action GUID. Unique identifier for the action instance in the current automation. Use this to refer to this action in the automation flow. If not specified, automatically generated by Wix. - name: type | type: Type | description: [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#action-type). - enum: - APP_DEFINED: Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#app-defined-action). This action type is available in the site dashboard. - CONDITION: Condition action. Evaluates a condition to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `conditionInfo.truePostActionIds` run and those in `conditionInfo.falsePostActionIds` are skipped. - CODE_CONDITION: Code condition action. Evaluates custom code to determine which action runs next. Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations. > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `codeConditionInfo.truePostActionIds` run and those in `codeConditionInfo.falsePostActionIds` are skipped. - DELAY: Delay. The automation must wait before executing the next step. - RATE_LIMIT: Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. - name: displayName | type: string | description: Editable display name for the action. - name: namespace | type: string | description: [Action namespace](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation.md#namespace). This differentiates it from other actions of the same type. If the action outputs any data, the data appears under the namespace in the payload sent to the subsequent steps in the automation. If the user has multiple actions with the same `appId` and `actionKey`, the output of the previous action is overwritten. - name: skipActionExpression | type: string | description: Evaluated to determine whether the action is skipped. When evaluated to `true`, the action is skipped. Otherwise, the action runs. When empty, the action runs. - name: origin | type: Origin | description: How the automation was added to the user's site. - enum: - USER: Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-user). - APPLICATION: Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary.md#wix-app) for a particular site. - PREINSTALLED: [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations.md). - name: settings | type: AutomationSettings | description: Automation settings. Applied only for pre-installed and application automations. Not applied to User origin automations - name: hidden | type: boolean | description: Whether the automation is hidden from users. Default: `false` - name: readonly | type: boolean | description: Whether the automation is read-only. When `true`, site owners can't modify the automation or any of its actions. When `false`, users can configure specific actions as skippable or read-only using `settings.actionSettings`. Default: `false`. > **Note**: Setting `readOnly` to `true` overrides `settings.actionSettings`. - name: disableDelete | type: boolean | description: Whether to disable the option to delete the automation from the site. Default: `false`. - name: disableStatusChange | type: boolean | description: Whether to disable the option to change the automation's `configuration.status`. Default: `false`. - name: actionSettings | type: ActionSettings | description: Automation action settings. - name: permanentActionIds | type: array | description: IDs of actions whose `skipActionExpression` can't be modified. An action's `skipActionExpression` determines whether the action is skipped. Including an action's GUID in this array makes its `skipActionExpression` permanent, so it can't be changed. When empty, the `skipActionExpression` of all actions can be edited. - name: readonlyActionIds | type: array | description: IDs of read-only actions. Read-only actions cannot be modified. When empty and the automation's `settings.readonly` is `false`, all actions are modifiable. - name: draftInfo | type: DraftInfo | description: When the automation is a draft, the draft details. - name: originalAutomationId | type: string | description: GUID of the original automation. - name: archived | type: boolean | description: Whether the automation is archived. To archive an automation, set this to `true`. To restore an archived automation, set this to `false`. - name: autoArchivePolicy | type: AutoArchivePolicy | description: Auto archive policy - name: archiveDate | type: Date | description: Date when to archive the automation If this date in the past, nothing will happen (automation will not go into archived state) If this date in the future, on this date the automation will be updated with archived = true and configuration.status = INACTIVE After this date the automation may be unarchived and archived again, this date will have no influence - name: _createdDate | type: Date | description: Date and time the function production was created. - name: _updatedDate | type: Date | description: Date and time the function production was last updated. ``` ### Examples ### updateFunctionProduction ```javascript import { functionProductions } from '@wix/functions'; async function updateFunctionProduction(_id,functionProduction) { const response = await functionProductions.updateFunctionProduction(_id,functionProduction); }; ``` ### updateFunctionProduction (with elevated permissions) ```javascript import { functionProductions } from '@wix/functions'; import { auth } from '@wix/essentials'; async function myUpdateFunctionProductionMethod(_id,functionProduction) { const elevatedUpdateFunctionProduction = auth.elevate(functionProductions.updateFunctionProduction); const response = await elevatedUpdateFunctionProduction(_id,functionProduction); } ``` ### updateFunctionProduction (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { functionProductions } from '@wix/functions'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { functionProductions }, // Include the auth strategy and host as relevant }); async function updateFunctionProduction(_id,functionProduction) { const response = await myWixClient.functionProductions.updateFunctionProduction(_id,functionProduction); }; ``` ---