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

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

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.0
File Size Uploaded
leap_workflows_python_sdk-2.0.0.tar.gz 53.7 kB Details

Built distribution (wheel)

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

Total release size: 133.9 kB

Release files / leap_workflows_python_sdk-2.0.0.tar.gz

Download URL leap_workflows_python_sdk-2.0.0.tar.gz
Size 53.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4569c37b7bb4bb1a6932ff27814ec575572485d4e67548cc13c1dfb98f395bd2
BLAKE2b-256 checksum
How to use checksums
186c6934f729551aa6bd185ffa622a70c1fadc12b6ece33d2892857444c6d72a
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.0-py3-none-any.whl

Download URL leap_workflows_python_sdk-2.0.0-py3-none-any.whl
Size 80.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc939611766e7372213690f63a31dae0951347bb5db08254355024518dd2d63c
BLAKE2b-256 checksum
How to use checksums
bf39066e6b7004882e57333c5bf438ed116e6d6f6fa013f03a951d05035db6fe
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

2.0.1

2 release files

This release

2.0.0 This release

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