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 theDemo User
role or the string "0" to indicate that this workflow template is only visible to users without theDemo 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.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 usertemplates
(array oftemplate
) - optional: templates of sets of steps to use for items added usingaddItem
stepssteps
(array ofstep
) - required: the steps in the workflow; see below for step object specificationversion
(string) - required: version string; used to know when to update a templatedescription
(string) - optionaldemo
(boolean) - optional: if set to true, this will only be visible as a template to users with theDemo 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 thesession.properties
object must be strings, a demo workflow template is denoted bysession.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 ofinstruction
,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 oftrigger
) - optional: list of triggers that will trigger this steptext
(string) - optional: the text associated with this stepsteps
(array ofstep
) - optional: list of substepsmedia
(array ofmedia
) - optional: the step image(s) displayed to the user; can be used alongside textvideo
(array ofmedia
) - 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 stepchoiceId
(string) - optional: choice id in the triggering step that will trigger this step, if the stepId points to a step of typechoice
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 usingaddItem
Requirable step types:
Where
step.type
is instruction
:isRequired
(boolean) - optional, defaults to false
Where
step.type
is choice
:choices
(array ofchoice
) - required: list of choicesisRequired
(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 usergroup
(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 0isRequired
(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 tonested
, 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 itemverbiage
(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 ""
Last modified 2yr ago