MCPcopy
hub / github.com/simstudioai/sim / with_input_example

Function with_input_example

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

Example 2: Workflow execution with input data

()

Source from the content-addressed store, hash-verified

30
31
32def with_input_example():
33 """Example 2: Workflow execution with input data"""
34 client = SimStudioClient(api_key=os.getenv("SIM_API_KEY"))
35
36 try:
37 result = client.execute_workflow(
38 "your-workflow-id",
39 input_data={
40 "message": "Hello from Python SDK!",
41 "user_id": "12345",
42 "data": {
43 "type": "analysis",
44 "parameters": {
45 "include_metadata": True,
46 "format": "json"
47 }
48 }
49 },
50 timeout=60.0 # 60 seconds
51 )
52
53 if result.success:
54 print("✅ Workflow executed successfully!")
55 print(f"Output: {result.output}")
56 if result.metadata:
57 print(f"Duration: {result.metadata.get('duration')} ms")
58 else:
59 print(f"❌ Workflow failed: {result.error}")
60
61 except SimStudioError as error:
62 print(f"SDK Error: {error} (Code: {error.code})")
63 except Exception as error:
64 print(f"Unexpected error: {error}")
65
66
67def status_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