About Function Creation and Activation

This article explains the different approaches for creating and activating functions using the Functions APIs. For an overview of function components and architecture, see Function Architecture.

Once you've chosen your function type or template, you need to define the function's logic. For some function types, you also need to define its service plugin configuration. Once you've defined these things, you can create your function. After creating a function, activate it to make it live.

Quick creation and configuration

Wix provides 2 streamlined approaches for creating functions that combine function creation, logic attachment, and service plugin configuration:

These methods eliminate the need to call multiple APIs separately, making function creation more efficient for developers.

Note: Each function template is compatible with either the basic flow or the builderless flow, but not both. Function templates that you can use in the builderless flow are those that contain a formTemplateExtensionId.

Basic creation and configuration

Create a function that's ready to use by calling Create Function Production. This combines creating a function, attaching a function method (and the logic defined in the automation) to it, and configuring the function's service plugin configuration.

Depending on the function type, you may still need to edit its logic or service plugin configuration before you can activate it.

Builderless creation and configuration

Create a function that's ready to use by calling Create Function Builderless Production. This combines creating a function, attaching a function method (and the logic defined in the automation) to it, and configuring the function's service plugin configuration.

Builderless creation is often more efficient than basic creation, but it's only possible if the template you want to use contains a formTemplateExtensionId.

Notes:

  • To retrieve the form values required for a builderless creation, call the Form Schema API's List Forms method, specifying the following parameters:
    • namespace: wix.function_template.form
    • formIds: An array that contains the function template's formTemplateExtensionId
    • kind: EXTENSION
  • You can update functions created this way by calling Update Function Builderless Production. You can also use the other Functions APIs to update the function, but after doing so you can no longer update the function using Update Function Builderless Production.

You can activate functions created this way immediately.

Function activation and execution

Activating a function means that it will run when triggered by the business solution.

Activate a function by calling Upsert Function Activation. This creates a function activation that you can delete to deactivate the function. Any changes to the function will only take effect if you call Upsert Function Activation again.

See also

Did this help?