Notebook Trigger

The Notebook Trigger will fire a workflow whenever the selected Losant Notebook has completed an execution (either successfully, or with errors).

Notebook Trigger

Node Properties

The trigger only takes one parameter:

Notebook Configuration

A notebook that you previously created. Then, whenever an execution of that notebook completes, the workflow will trigger with the result of that execution.

Payload

In the general case, an Notebook Trigger workflow payload will look like the following:

{
  "applicationId": "555555555555eeeeeeeeeeee",
  "applicationName": "My Great Application",
  "data": {
    "success": true,
    "notebook": {
      "applicationId": "555555555555eeeeeeeeeeee",
      "creationDate": "2019-03-10T21:04:44.293Z",
      "description": "",
      "id": "<ID of the notebook>",
      "inputs": [
        {
          "queryJson": "{ }",
          "dataTableId": "5c9e2e4eab635b000620d17d",
          "inputType": "dataTable",
          "fileName": "example.csv"
        }
      ],
      "jupyterFileName": "yourNotebook.ipynb",
      "jupyterFileUrl": "https://example.com/yourNotebook.ipynb",
      "lastUpdated": "2019-03-12T20:17:49.879Z",
      "notebookId": "<ID of the notebook>",
      "name": "Your Notebook",
      "outputs": [
        {
          "outputType": "executionResult",
          "fileName": "result.ipynb"
        }
      ]
    },
    "execution": {
      "applicationId": "555555555555eeeeeeeeeeee",
      "executionErrors": [],
      "executionRelativeTo": "2019-04-18T18:30:29.368Z",
      "id": "5cb53464d0103e0006f34c74",
      "inputInfo": {
        "example.csv": {
          "contentType": "text/csv",
          "url": "https://example.com/example.csv",
          "size": 12345
        }
      },
      "inputsCompletedAt": "2019-04-18T18:30:31.368Z",
      "maxAllowedRunMinutes": 5,
      "notebookCompletedAt": "2019-04-18T18:30:32.368Z",
      "notebookExecutionId": "5cb53464d0103e0006f34c74",
      "notebookId": "<ID of the notebook>",
      "outputInfo": {
        "result.ipynb": {
          "url": "https://example.com/result.ipynb",
          "size": 54321
        }
      },
      "outputsCompletedAt": "2019-04-18T18:30:34.368Z",
      "runQueuedAt": "2019-04-18T18:30:29.368Z",
      "runStartedAt": "2019-04-18T18:30:30.368Z",
      "sourceType": "user",
      "sourceId": "58c314ec27f78200017d4ee1",
      "status": "completed",
      "templateContext": "{\"foo\": \"bar\"}"
    }
  },
  "flowId": "333333333333cccccccccccc",
  "flowName": "My Great Workflow",
  "flowVersion": "myFlowVersion",
  "globals": {
    "aJsonGlobal": {
      "key": "value"
    },
    "aNumberGlobal": 42,
    "aStringGlobal": "My value"
  },
  "relayId": "<ID of the notebook>",
  "relayType": "notebook",
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "triggerId": "<ID of the notebook>",
  "triggerType": "notebook"
}

The data object will include the following properties:

  • success: This will be true if the notebook execution succeeded, and false if the notebook execution failed. If the notebook execution failed, more details can be found in the executionErrors array under the execution object.
  • notebook: This is an object containing all the information about the notebook that was run. It conforms to the Notebook API Schema.
  • execution: This is an object containing all the information about the particular execution of the notebook. It conforms to the Notebook Execution Schema.
    • Note: The templateContext will be a stringified JSON object. If you wish to parse it and read specific values, you can do so with a JSON: Decode Node.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.