MCPcopy Index your code
hub / github.com/simstudioai/sim / status_example

Function status_example

packages/python-sdk/examples/basic_usage.py:67–90  ·  view source on GitHub ↗

Example 3: Workflow validation and status checking

()

Source from the content-addressed store, hash-verified

65
66
67def status_example():
68 """Example 3: Workflow validation and status checking"""
69 client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
70
71 try:
72 # Check if workflow is ready
73 is_ready = client.validate_workflow("your-workflow-id")
74 print(f"Workflow ready: {is_ready}")
75
76 # Get detailed status
77 status = client.get_workflow_status("your-workflow-id")
78 print(f"Status: {{\n"
79 f" deployed: {status.is_deployed},\n"
80 f" needs_redeployment: {status.needs_redeployment},\n"
81 f" deployed_at: {status.deployed_at}\n"
82 f"}}")
83
84 if status.is_deployed:
85 # Execute the workflow
86 result = client.execute_workflow("your-workflow-id")
87 print(f"Result: {result}")
88
89 except Exception as error:
90 print(f"Error: {error}")
91
92
93def context_manager_example():

Callers 1

basic_usage.pyFile · 0.85

Calls 4

validate_workflowMethod · 0.95
get_workflow_statusMethod · 0.95
execute_workflowMethod · 0.95
SimStudioClientClass · 0.90

Tested by

no test coverage detected