Skip to main content

Visit Leap Workflows

Leap Workflows

The 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.

PyPI README.md More Info

Table of Contents

Requirements

Python >=3.7

Installation

pip install leap-workflows-python-sdk==2.0.1

Getting Started

from pprint import pprint
from leap_workflows import Leap, ApiException

leap = Leap(
    api_key="YOUR_API_KEY",
)

try:
    # Get a workflow run
    get_workflow_run_response = leap.workflow_runs.get_workflow_run(
        workflow_run_id="rnp_x3p27VQk6MyJfLe",
    )
    print(get_workflow_run_response)
except ApiException as e:
    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)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from leap_workflows import Leap, ApiException

leap = Leap(
    api_key="YOUR_API_KEY",
)


async def main():
    try:
        # Get a workflow run
        get_workflow_run_response = await leap.workflow_runs.aget_workflow_run(
            workflow_run_id="rnp_x3p27VQk6MyJfLe",
        )
        print(get_workflow_run_response)
    except ApiException as e:
        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 Response

To access raw HTTP response values, use the .raw namespace.

from pprint import pprint
from leap_workflows import Leap, ApiException

leap = Leap(
    api_key="YOUR_API_KEY",
)

try:
    # Get a workflow run
    get_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)
except ApiException as e:
    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)

Reference

leap.workflow_runs.get_workflow_run

This endpoint retrieves the details of a specific workflow run using its workflow_run_id.

🛠️ Usage

get_workflow_run_response = leap.workflow_runs.get_workflow_run(
    workflow_run_id="rnp_x3p27VQk6MyJfLe",
)

⚙️ Parameters

workflow_run_id: str

The ID of the workflow run to retrieve.

🔄 Return

WorkflowRunEntity

🌐 Endpoint

/v1/runs/{workflow_run_id} get

🔙 Back to Table of Contents


leap.workflow_runs.workflow

This endpoint lets the user run a specified workflow with the provided workflow definition.

🛠️ Usage

workflow_response = leap.workflow_runs.workflow(
    workflow_id="wkf_i3F5UjpZ2Vg",
    webhook_url="https://myapp.com/webhook",
    input={
        "first_name": "Sam",
        "last_name": "Altman",
    },
)

⚙️ Parameters

workflow_id: str

The ID of the workflow to be run.

webhook_url: str

The URL to which the workflow results should be sent to on completion.

input: RunWorkflowDtoInput

⚙️ Request Body

RunWorkflowDto

🔄 Return

WorkflowRunEntity

🌐 Endpoint

/v1/runs post

🔙 Back to Table of Contents


Author

This Python package is automatically generated by Konfig

Metadata

Release files for leap-workflows-python-sdk 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leap-workflows-python-sdk 2.0.1
File Size Uploaded
leap_workflows_python_sdk-2.0.1.tar.gz 53.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leap-workflows-python-sdk 2.0.1
File Interpreter ABI Platform
leap_workflows_python_sdk-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 134.7 kB

Release files / leap_workflows_python_sdk-2.0.1.tar.gz

Download URL leap_workflows_python_sdk-2.0.1.tar.gz
Size 53.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ada9ceff2bb14df61266f1a94263407e499fdba0c33e3a5817f9cd1f6925100e
BLAKE2b-256 checksum
How to use checksums
99a8553cb2c5ce608b0524f43965a47615efd9a75b7352867cd98e6561721205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / leap_workflows_python_sdk-2.0.1-py3-none-any.whl

Download URL leap_workflows_python_sdk-2.0.1-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc9307d9185513f2b516a1a935afe8a193dbd939e49a8c0989581ac03e063fd4
BLAKE2b-256 checksum
How to use checksums
d15c34238410ac879d2632991129d161ffab04a5f07d6d6f1c3bdfd81554ecd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

2.0.3

2 release files

2.0.2

2 release files

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page