Skylight Docs
Search
K

Integrate directly with your data using the Skylight SDK

Use the Skylight SDK to create workflow template sessions. Along with populating the session data defined by the JSON Structure section below, these sessions also have specific fields in the session.properties object.
  • session.properties.type must be set to the string "template".
  • session.properties.demo should be set to either the string "1" to denote that this workflow template is only visible to users with the Demo User role or the string "0" to indicate that this workflow template is only visible to users without the Demo User role. If left unspecified, the workflow template will default to be a non-demo workflow template.
It is important to remember that updating the session.properties object overwrites any existing keys and values.

JSON Structure

This is the JSON structure of a workflow as it exists in application data or the session data of a workflow template session.
The basic data model describing a workflow item and its steps:
{
"id": "theWorkflowId",
"name": "The workflow name",
"templates": [
"steps": [
]
],
"steps": [
{
"type": "choice",
"id": "theStepId",
"text": "The step instruction",
"isRequired": true,
"choices": [
{
"id": "choice1",
"text": "Yes"
},
{
"id": "choice2",
"text": "No"
}
]
}
]
}
At the root level:
  • id (string) - required: each workflow must have a unique id (unique across all workflow)
  • name (string) - required: the workflow name displayed to the user
  • templates (array of template) - optional: templates of sets of steps to use for items added using addItem steps
  • steps (array of step) - required: the steps in the workflow; see below for step object specification
  • version (string) - required: version string; used to know when to update a template
  • description (string) - optional
  • demo (boolean) - optional: if set to true, this will only be visible as a template to users with the Demo User role; defaults to false
    • this field is only for workflow templates defined in application data
    • in session data, the session.properties.demo field is used instead. As values in the session.properties object must be strings, a demo workflow template is denoted by session.properties.demo being set to the string "1" (or the string "0" if it isn't a demo workflow template)
At the step level:
  • type (string) - required (one of instruction, section, choice, captureText, capturePhoto,captureVideo, captureScan,call, submit, addItem, deleteItem, exitItem)
  • id (string) - required: each step must have a unique id (unique within the workflow)
  • label (string) - required: this will show up as the label for the step, e.g. "Step 5.4"
  • triggers (array of trigger) - optional: list of triggers that will trigger this step
  • text (string) - optional: the text associated with this step
  • steps (array of step) - optional: list of substeps
  • media (array of media) - optional: the step image(s) displayed to the user; can be used alongside text
  • video (array of media) - optional: the step videos(s) displayed to the user; can be used alongside text
  • see below for additional fields based on the step type
At the trigger level:
  • stepId (string) - required: step that must be complete to trigger this step
  • choiceId (string) - optional: choice id in the triggering step that will trigger this step, if the stepId points to a step of type choice
At the media level:
  • uri (string) - required: the URI for the media
At the template level:
  • steps (array of step) - required: these are the steps that will be used when a new item is added using addItem
Requirable step types:
Where step.type is instruction:
  • isRequired (boolean) - optional, defaults to false
Where step.type is choice:
  • choices (array of choice) - required: list of choices
  • isRequired (boolean) - optional, defaults to false
At the choice level:
  • id (string) - required: each choice must have a unique id (unique within the step)
  • text (string) - required: the choice text displayed to the user
  • group (string) - optional: if specified, choosing this choice will clear out other groups' choice selections
Where step.type is captureText
  • textInputType (string) - optional: one of 'generic' or 'numeric' to indicate the possible input characters, defaults to 'generic'
  • text (string) - optional: the step instruction displayed to the user; defaults to "Capture text"
  • isRequired (boolean) - optional, defaults to false
Where step.type is capturePhoto
  • text (string) - optional: the step instruction displayed to the user; defaults to "Capture photo"
  • delay (number) - optional: the delay (in seconds) until a photo is taken; a value of 0 means manual capture; defaults to 0
  • isRequired (boolean) - optional, defaults to false
Where step.type is captureScan
  • text (string) - optional: the step instruction displayed to the user; defaults to "Capture scan"
  • isRequired (boolean) - optional, defaults to false
Where step.type is captureVideo
  • text (string) - optional: the step instruction displayed to the user; defaults to "Capture video"
  • isRequired (boolean) - optional, defaults to false
Requirability depends on children:
Where step.type is section
  • display (string) - optional: if set to nested, substeps will be in a new view; defaults to adding substeps inline
Unrequirable step types:
Where step.type is call
  • text (string) - optional: the step instruction displayed to the user; defaults to "Join call"
Where step.type is submit
  • text (string) - optional: the step instruction displayed to the user; defaults to "Submit"
Where step.type is addItem
  • text (string) - optional: the step instruction displayed to the user; defaults to ""
  • template (string) - required: the template id of the cards that should exist in the added item
  • verbiage (object) - optional:
    • singular (string) - optional: singular noun for the item; defaults to "Item"
    • plural (string) - optional: plural noun for the item; defaults to "Items"
Where step.type is deleteItem
  • text (string) - optional: the step instruction displayed to the user; defaults to ""
Where step.type is exitItem
  • text (string) - optional: the step instruction displayed to the user; defaults to ""