Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Documentation for Create Execution from Workflow endpoint - no using Inputs info #2138

Open
japerry911 opened this issue Jan 26, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@japerry911
Copy link
Contributor

Description

I think there is missing documentation on the create execution from Workflow endpoint. It's not showing that you can add inputs as a form data body - checked the network tab when Triggered Kestra Workflow in UI and found how to do inputs. I am happy to add this to API docs, but I couldn't find where that it is at.

Documentation URL here

Here's image showing current docs for corresponding endpoint:

Image

Here's image showing inputs as request body option in network tab -

Image

@japerry911 japerry911 added the documentation Improvements or additions to documentation label Jan 26, 2025
@kestrabot kestrabot bot added this to Issues Jan 26, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jan 26, 2025
@japerry911
Copy link
Contributor Author

For what it's worth this works 🚀 didn't notice it was the multipart content type

    def create_execution_from_flow_id(
        self,
        namespace: str,
        flow_id: str,
        inputs: dict[str, Any] | None = None,
    ) -> dict[str, Any]:
        url = (
            f"{self.base_url}/api/v1/{self.tenant}/executions/{namespace}/{flow_id}"
            "?wait=false"
        )

        # Convert inputs to form-data fields
        files = {}
        if inputs:
            for key, value in inputs.items():
                files[key] = (None, str(value))

        response = requests.post(
            url,
            headers={
                "Authorization": f"Bearer {self.api_key}",
            },
            files=files,
        )

        return response.json()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Backlog
Development

No branches or pull requests

1 participant