> 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 # ReportActionInvocationCompleted # Package: triggers # Namespace: EsbRuntimeService # Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-action-invocation-completed.md ## Permission Scopes: Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS ## Introduction > **Note**: Call this method when using the [Action Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md) to run an action with a timeout. Reports to Wix that your action has completed. When Wix calls [Invoke](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/invoke.md) to run your [action that has a timeout](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md#action-timeouts), it pauses the automation until you call this method or until the timeout period ends. If your action has an [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema), include your action's results. If you don't call this method in the timeout period, Wix [marks the action as failed](https://support.wix.com/en/article/wix-automations-understanding-run-logs#understanding-statuses) and continues to the next step in the automation. Subsequent actions may fail if they rely on your action's output. --- ## REST API ### Schema ``` Method: reportActionInvocationCompleted Description: > **Note**: Call this method when using the [Action Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md) to run an action with a timeout. Reports to Wix that your action has completed. When Wix calls [Invoke](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/invoke.md) to run your [action that has a timeout](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md#action-timeouts), it pauses the automation until you call this method or until the timeout period ends. If your action has an [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema), include your action's results. If you don't call this method in the timeout period, Wix [marks the action as failed](https://support.wix.com/en/article/wix-automations-understanding-run-logs#understanding-statuses) and continues to the next step in the automation. Subsequent actions may fail if they rely on your action's output. URL: https://www.wixapis.com/v1/report-action-invocation-completed Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: invocationToken Method parameters: param name: invocationToken | type: invocationToken | description: Invocation token from Wix's original call to [Invoke](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/invoke.md). Wix uses this token to match your results with the correct automation run. Learn more about [running an invoked action with a timeout](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/sample-flow.md#run-an-invoked-action-with-a-timeout). | required: true param name: status | type: Status - enum: UNKNOWN_STATUS - Unknown action completion status. SUCCESS - Action completed successfully. FAILURE - Action failed to complete. - ONE-OF: - name: successInfo | type: SuccessInfo | description: When the `status` is `SUCCESS`, your action's results. - name: result | type: object | description: Your action's results as specified in its [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema). - name: failureInfo | type: FailureInfo | description: When the `status` is `FAILURE`, why the action failed. - name: errorDescription | type: string | description: Why the action failed. Return type: ReportActionInvocationCompletedResponse EMPTY-OBJECT {} ``` ### Examples ### Report a successful action ```curl curl -X POST 'https://manage.wix.com/esb-runtime-engine/v1/report-action-invocation-completed' \ -H 'authorization: ' \ -d '{ "status": "SUCCESS", "success_info": { "result": { "orderId": "230503cd-b40f-4296-ace2-52c23988de04", "totalItems": 5 } }, "invocation_token": "eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTc0NDI5MjIwNSwiaWF0IjoxNzQ0MjkyMjA1fQ.PEoBkoHLjBwjxBbWWA-ZL3MjpVMTymUC6wrxqjMVnEk" }' ``` ### Report a failed action ```curl curl -X POST 'https://manage.wix.com/esb-runtime-engine/v1/report-action-invocation-completed' \ -H 'authorization: ' \ -d '{ "status": "FAILURE", "failure_info": { "error_description": "Order ID was not found" }, "invocation_token": "eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTc0NDI5MjIwNSwiaWF0IjoxNzQ0MjkyMjA1fQ.PEoBkoHLjBwjxBbWWA-ZL3MjpVMTymUC6wrxqjMVnEk" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.triggers.EsbRuntimeService.reportActionInvocationCompleted(status, invocationToken, options) Description: > **Note**: Call this method when using the [Action Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md) to run an action with a timeout. Reports to Wix that your action has completed. When Wix calls [Invoke](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/invoke.md) to run your [action that has a timeout](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/introduction.md#action-timeouts), it pauses the automation until you call this method or until the timeout period ends. If your action has an [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema), include your action's results. If you don't call this method in the timeout period, Wix [marks the action as failed](https://support.wix.com/en/article/wix-automations-understanding-run-logs#understanding-statuses) and continues to the next step in the automation. Subsequent actions may fail if they rely on your action's output. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: invocationToken, status Method parameters: param name: invocationToken | type: string | description: Invocation token from Wix's original call to [Invoke](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/invoke.md). Wix uses this token to match your results with the correct automation run. Learn more about [running an invoked action with a timeout](https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-provider-service-plugin/sample-flow.md#run-an-invoked-action-with-a-timeout). | required: true param name: options | type: ReportActionInvocationCompletedOptions none - ONE-OF: - name: successInfo | type: SuccessInfo | description: When the `status` is `SUCCESS`, your action's results. - name: result | type: object | description: Your action's results as specified in its [output schema](https://dev.wix.com/docs/api-reference/business-management/automations/actions/about-actions.md#the-output-schema). - name: failureInfo | type: FailureInfo | description: When the `status` is `FAILURE`, why the action failed. - name: errorDescription | type: string | description: Why the action failed. param name: status | type: Status | required: true - enum: UNKNOWN_STATUS - Unknown action completion status. SUCCESS - Action completed successfully. FAILURE - Action failed to complete. Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### reportActionInvocationCompleted ```javascript import { activations } from '@wix/automations'; async function reportActionInvocationCompleted(status,invocationToken,options) { const response = await activations.reportActionInvocationCompleted(status,invocationToken,options); }; ``` ### reportActionInvocationCompleted (with elevated permissions) ```javascript import { activations } from '@wix/automations'; import { auth } from '@wix/essentials'; async function myReportActionInvocationCompletedMethod(status,invocationToken,options) { const elevatedReportActionInvocationCompleted = auth.elevate(activations.reportActionInvocationCompleted); const response = await elevatedReportActionInvocationCompleted(status,invocationToken,options); } ``` ### reportActionInvocationCompleted (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 { activations } from '@wix/automations'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { activations }, // Include the auth strategy and host as relevant }); async function reportActionInvocationCompleted(status,invocationToken,options) { const response = await myWixClient.activations.reportActionInvocationCompleted(status,invocationToken,options); }; ``` ---