Skip to content

Feature Request] Support Webhook/Callback for long-running code execution results #190

Description

@feifei325

Feature Description

Support for asynchronous code execution with a callback/webhook mechanism.

Use Case

I'm building an agent that performs long-running tasks (e.g., 10+ minutes of data analysis). Currently, I need to keep the SDK connection open to receive results via on_result or on_stdout. For these long tasks, a persistent connection is unreliable.

Proposed API

It would be great if sandbox.run_code or a similar method could accept a callback configuration:

# Conceptual example
sandbox.run_code(
    code="very_long_task()",
    callback_url="[https://my-api.com/v1/e2b-webhook](https://my-api.com/v1/e2b-webhook)",
    metadata={"task_id": "123"}
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKfeatureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions