When working with Workflow scripting in LabOperator, it is common for users to make mistakes in the YAML file. To encounter that, LabOperator provides its feature to show errors and warnings after checking the uploaded YAML file, and during the execution of a Workflow Run.
User case of uploading YAML with scripting errors
There are many possible errors during workflow development, but they can be mainly categorized into:
- LabOperator Schema invalidation errors
- Design logic errors
Schema invalidation errors when uploading to LabOperator
In this example YAML script file, there is a typo that the “stepOne” is not correctly defined in the “steps” section of the Workflow.
schema_version: '1.0.1' info: version: '0.0.1' uuid: f7cfccc4-204e-4c32-be6f-33a769439d1e title: Errors and Warnings Test: LO Schema Invalidation fields: testField: type: string hidden: true steps: stepOne: # Schema invalidation here info: title: Test substeps: - primary: Test expandDescription: true description: | This is a test YAML file !{{testField}} flow: - stepOne
When uploading to LabOperator, in the same window, the details of Schema invalidation could be seen.
Logic errors during the execution of Workflow Run
Many cases would cause Workflow Runs to fail during the execution, namely, wrong data fetching or accessing, wrong device selection with missing channels and commands, unallowed webhooks, etc.
In this example YAML script file, there is a button to trigger assigning values to a string field. To show the error notification in LabOperator, the assigned value is bound to the undefined field. This is a data fetching error during the execution of a Workflow Run.
schema_version: '1.0.1' info: version: '0.0.2' uuid: f7cfccc4-204e-4c32-be6f-33a769439d1e title: Errors and Warnings Test: Logic design fields: testField: type: string hidden: true steps: stepOne: info: title: Test substeps: - primary: Test expandDescription: true description: | This is a test YAML file !{{testField}} buttons: - label: Test key: keyTest color: secondary behaviors: - when: on_manual: key: keyTest do: - set_field: field: testField value: missingField # This is a logic error flow: - stepOne
After uploading this test script to LabOperator and starting a Workflow Run, when clicking on the button to assign value to the ‘testField’, there is a notification: WorkflowUtils::ScriptingError: no value provided for variables: missingField. If users start another Workflow Run, they will not see this notification.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article