KrewData Features / Real Time Execution / Executing Execution Unit
In This Topic
    Executing Execution Unit
    In This Topic

    Now, let us run the execution unit we have created. There are following two ways to run the execution unit.

    Data editing flow added to execution unit can be executed manually(Manual execution) from Flow Setting page.

     Set up kintone Account

    To be able to run the execution unit, you need to set a login ID and password of the kintone environment.

    • krewData runs the data editing flow in the kintone account specified in the user information. Please provide the kintone account that has appropriate permissions for input output apps used in the data editing flow.
    • The provided user information is used to execute all execution units.
    • If user information is changed, all execution units will be executed as per the new user.
    • In case kintone password has changed or expired, the user information of krewData needs to be set again.

    To set up the kintone account, select the User Information option from menu in left side of the File tab.

    If kintone account has not been configured at the time of executing the data editing flow, or while setting up the execution unit, the User Information page gets displayed and you are asked to set up the kintone account.

    After filling in the user information, click the Check Account button to verify that the user information you entered is correct.

    After verifying that the user information is correct, click Update App to save the user information.

    Validity of kintone account set in user information is as follows.

    • Webhook/API Execution/Manual Execution
      kintone account set up while registering an execution unit gets saved. There is no need to re-configure the account.

    Use in Environments with IP Address Restrictions

    To run a data editing flow in a kintone environment with IP address restrictions, you must fill in information in Basic Authentication Setting or Secure Access Setting section depending on your environment settings.

    Depending on the IP address restrictions and availability of Basic authentication or secure access settings, the data editing flow may or may not be executed. For more details, see Environment with IP Address Restrictions.

     Webhook

    Settings required for running the execution unit through Webhook are as follows:

    1. Click icon in Execution Method column to open Execution Method dialog and perform the following steps:
      1. Select "Webhook" in Execution Method.
      2. Copy the URL.
      3. Click OK button.
    2. Click Update App on Plug-in Settings page.
    3. Configure Webhook in kintone app set in the Calling App column of the execution unit. Steps to configure Webhook in a kintone app are standard (Setting Webhook ). Following are those standard steps mentioned in the context of krewData.
      1. Go to the App Settings tab on Settings page of the app,  and click Customization and Integration > Webhooks.
      2. Click the Add button [+] icon.
      3. Enter all the items.
        • Description
          Enter the description of configured Webhook app such as name of the execution unit created in krewData.
        • Webhook URL
          Enter the URL copied in Step 1-b.
        • Event 
          Specify the event of sending Webhook notification.
        • Activation
          If checkbox is OFF, activate by checking it ON. By default, it is activated.
      4. Click Save.
      5. Click Back to App Settings in bottom right of the page.
      6. Click Update App on the top right side of the page.
    4. In app in which Webhook has been configured, perform the operation specified in the Step 3-c.
       This action sends Webhook notification from the kintone app and runs the execution unit of configured URL.

    Update your app by checking ON the checkbox in Enabled column of the execution unit. This enables the URL and allows real time execution. When the checkbox is in OFF state, webhook notifications from the kintone app fail and the execution unit is not executed.

     API Execution

    Settings required to run the execution unit through API are as follows:

    1. Click icon in Execution Method column to open Execution Method dialog and perform the following steps:
               
      1. Select "API" in Execution Method.
      2. Copy the URL.
      3. Click OK button.
    2. Click Update App on Plug-in Settings page.
    3. Use an execution API to customize the kintone app or create an external application. For more information about execution APIs, see API Reference.
    4. Perform an operation to run the execution API in customized kintone app or external application.
      The execution API runs, and the execution unit of the configured URL is executed.

    Update your app by checking ON the checkbox in Enabled column of the execution unit. This enables the URL and allows real time execution. When the checkbox is in OFF state, API request fails and the execution unit is not executed.

     Manual Execution

    Each data editing flow that is added to an execution unit can also be executed standalone manually by clicking the Run button of flow creation area.

    Parameter setting for manual execution and preview

    To run a data editing flow for testing purpose while creating it, you can set any tentative values in parameters and confirm the result in Preview tab by executing the flow.

    1. Click the Set Parameter icon in the upper right corner of the Flow Setting page to open the Parameter Setting for Manual Execution page.

    2. On the parameter settings page, select the fields to set parameters at the time of manual execution and set their values.

    Tentative values of parameters set on the Parameter Setting for Manual Execution page are applied only during preview and manual execution (by pressing Run button in the upper right corner of the page), and is not valid when called from Webhook or API.
     Exclusive Control

    Real time execution locks all the data editing flows contained in an execution unit at run time and prevents calls to that execution unit by other real time executions.

    • If Concurrency Behavior is set to Cancel The Request in the execution unit setting and another user executes the execution unit which is already running, an error is thrown instantly.
    • If Concurrency Behavior is set to Waiting the execution in the execution unit setting and another user executes the execution unit which is already running, it waits for current execution unit to end before starting the new execution.
    • If Concurrency Behavior is set to Waiting the execution in the execution unit setting and another user waits for completion of already running execution unit, timeout error occurs after certain amount of time.
     Error in Real Time Execution

    When performing real time execution through Webhook or execution API, if error occurs due to exclusive control, timeout, or any other reason, the data editing flow is not executed and records are not added or updated to the output app.

    Example of error occurred due to exclusive control

           
    • Run ExecutionUnit1 based on record information updated by User1. Execution results of Flow1 are reflected in the output app.
    • Real time execution launched by User2 does not perform Flow1 due to error and User2 updates are not reflected in the output app.
    See Also