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

Function basic_example

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

Example 1: Basic workflow execution

()

Source from the content-addressed store, hash-verified

8
9
10def basic_example():
11 """Example 1: Basic workflow execution"""
12 client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
13
14 try:
15 # Execute a workflow without input
16 result = client.execute_workflow("your-workflow-id")
17
18 if result.success:
19 print("✅ Workflow executed successfully!")
20 print(f"Output: {result.output}")
21 if result.metadata:
22 print(f"Duration: {result.metadata.get('duration')} ms")
23 else:
24 print(f"❌ Workflow failed: {result.error}")
25
26 except SimStudioError as error:
27 print(f"SDK Error: {error} (Code: {error.code})")
28 except Exception as error:
29 print(f"Unexpected error: {error}")
30
31
32def with_input_example():

Callers 1

basic_usage.pyFile · 0.85

Calls 3

execute_workflowMethod · 0.95
SimStudioClientClass · 0.90
getMethod · 0.65

Tested by

no test coverage detected