Package: leap-workflows-python-sdk
Leap WorkflowsThe Leap Workflows API allows developers to run workflows, fetch workflow runs, and provide other utility functions related to workflow runs. Please use the X-Api-Key for authenticated requests.Table of ContentsRequirementsInstallationGetting StartedAsyncRaw HTTP ResponseReferenceleap.workflow_runs.get_workflow_runleap.workflow_runs.workflowRequirementsPython >=3.7Installationpipinstallleap-workflows-python-sdk==2.0.0Getting Startedfrompprintimportpprintfromleap_workflowsimportLeap,ApiExceptionleap=Leap(api_key="YOUR_API_KEY",)try:# Get a workflow runget_workflow_run_response=leap.workflow_runs.get_workflow_run(workflow_run_id="rnp_x3p27VQk6MyJfLe",)print(get_workflow_run_response)exceptApiExceptionase:print("Exception when calling WorkflowRunsApi.get_workflow_run:%s\n"%e)pprint(e.body)pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Asyncasyncsupport is available by prependingato any method.importasynciofrompprintimportpprintfromleap_workflowsimportLeap,ApiExceptionleap=Leap(api_key="YOUR_API_KEY",)asyncdefmain():try:# Get a workflow runget_workflow_run_response=awaitleap.workflow_runs.aget_workflow_run(workflow_run_id="rnp_x3p27VQk6MyJfLe",)print(get_workflow_run_response)exceptApiExceptionase:print("Exception when calling WorkflowRunsApi.get_workflow_run:%s\n"%e)pprint(e.body)pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)asyncio.run(main())Raw HTTP ResponseTo access raw HTTP response values, use the.rawnamespace.frompprintimportpprintfromleap_workflowsimportLeap,ApiExceptionleap=Leap(api_key="YOUR_API_KEY",)try:# Get a workflow runget_workflow_run_response=leap.workflow_runs.raw.get_workflow_run(workflow_run_id="rnp_x3p27VQk6MyJfLe",)pprint(get_workflow_run_response.body)pprint(get_workflow_run_response.body["id"])pprint(get_workflow_run_response.body["version_id"])pprint(get_workflow_run_response.body["status"])pprint(get_workflow_run_response.body["created_at"])pprint(get_workflow_run_response.body["started_at"])pprint(get_workflow_run_response.body["ended_at"])pprint(get_workflow_run_response.body["workflow_id"])pprint(get_workflow_run_response.body["error"])pprint(get_workflow_run_response.body["input"])pprint(get_workflow_run_response.body["output"])pprint(get_workflow_run_response.headers)pprint(get_workflow_run_response.status)pprint(get_workflow_run_response.round_trip_time)exceptApiExceptionase:print("Exception when calling WorkflowRunsApi.get_workflow_run:%s\n"%e)pprint(e.body)pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Referenceleap.workflow_runs.get_workflow_runThis endpoint retrieves the details of a specific workflow run using itsworkflow_run_id.🛠️ Usageget_workflow_run_response=leap.workflow_runs.get_workflow_run(workflow_run_id="rnp_x3p27VQk6MyJfLe",)⚙️ Parametersworkflow_run_id:strThe ID of the workflow run to retrieve.🔄 ReturnWorkflowRunEntity🌐 Endpoint/v1/runs/{workflow_run_id}get🔙Back to Table of Contentsleap.workflow_runs.workflowThis endpoint lets the user run a specified workflow with the provided workflow definition.🛠️ Usageworkflow_response=leap.workflow_runs.workflow(workflow_id="wkf_i3F5UjpZ2Vg",webhook_url="https://myapp.com/webhook",input={"first_name":"Sam","last_name":"Altman",},)⚙️ Parametersworkflow_id:strThe ID of the workflow to be run.webhook_url:strThe URL to which the workflow results should be sent to on completion.input:RunWorkflowDtoInput⚙️ Request BodyRunWorkflowDto🔄 ReturnWorkflowRunEntity🌐 Endpoint/v1/runspost🔙Back to Table of ContentsAuthorThis Python package is automatically generated byKonfig