The SDK surface for triggering workflows and managing alerts on a twin. For building workflows and
the node taxonomy, see the Workflows feature pages.
Workflows
List, trigger, and monitor workflows programmatically:
cw = Cyberwave()
for wf in cw.workflows.list():
print ( f " { wf.name } ( { wf.slug } ) — { wf.status } " )
# Trigger by UUID or unified slug
run = cw.workflows.trigger(
"acme/workflows/pick-and-place" ,
inputs = { "target_position" : [ 1.0 , 2.0 , 0.0 ], "speed" : 0.5 },
)
run.wait( timeout = 60 )
print (run.status, run.result)
Start from a Workflow object, or look up by slug:
wf = cw.workflows.get( "acme/workflows/pick-and-place" )
run = wf.trigger( inputs = { "speed" : 1.0 })
run.wait()
wf = cw.workflows.get_by_slug( "acme/workflows/pick-and-place" )
List and filter past runs:
runs = cw.workflow_runs.list( workflow_id = "workflow-uuid" , status = "error" )
for r in runs:
print (r.uuid, r.status, r.error)
Check if a workflow is currently running:
if cw.workflows.is_running( "workflow-uuid" ):
print ( "Workflow is currently executing" )
is_running() returns True when any run has status running, waiting, or requested.
Workflows Overview Automated sequences, cloud vs. edge execution, and the node taxonomy.
Alerts
Create, manage, and respond to alerts on a twin. Alerts notify operators that action is needed
(e.g. a robot needs calibration or a sensor reading is out of range).
twin = cw.twin( twin_id = "your_twin_uuid" )
alert = twin.alerts.create(
name = "Calibration needed" ,
description = "Joint 3 is drifting beyond tolerance" ,
severity = "warning" ,
alert_type = "calibration_needed" ,
)
Severity Description infoInformational notice warningRequires attention errorSomething is wrong criticalImmediate action needed
Manage the alert lifecycle:
for a in twin.alerts.list( status = "active" ):
print (a.name, a.severity, a.status)
alert.acknowledge()
alert.resolve()
alert.silence()
alert.update( severity = "critical" )
alert.delete()
Bypass backend deduplication and always create a new alert:
alert = twin.alerts.create(
name = "Calibration needed" ,
alert_type = "calibration_needed" ,
force = True ,
)
Alerts (Edge & Drivers) Alert categories and operator notification on the edge.