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 · 5 comments
Assignees
Labels
area/frontend Needs frontend code changes bug Something isn't working kind/customer-request Requested by one or more customers kind/quick-win Seems to be quick to do

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()

@anna-geller anna-geller added area/docs Issues related to documentation, plugin examples, blueprints, and guides enhancement New feature or request area/frontend Needs frontend code changes kind/quick-win Seems to be quick to do kind/customer-request Requested by one or more customers and removed documentation Improvements or additions to documentation area/docs Issues related to documentation, plugin examples, blueprints, and guides labels Feb 10, 2025
@anna-geller
Copy link
Member

@Skraye can you help with that to just briefly note technically how this should be handled? we can then find the right place to document it with @aj-emerich

@Skraye
Copy link
Member

Skraye commented Feb 13, 2025

The above swagger is generate from an openApi spec file and this file is generated from our annotation in the code.
It seems there is already a description : https://github.com/kestra-io/kestra/blob/develop/webserver/src/main/java/io/kestra/webserver/controllers/api/ExecutionController.java#L619
But when looking at the openApi file, its missing, so we need to dig in the library that generate the openApi file

Short term solution: precise it in the method description (see a bit above the line I sent)

@aj-emerich
Copy link
Contributor

@Skraye It's unclear to me which next action to take to document.

@Skraye
Copy link
Member

Skraye commented Feb 14, 2025

Well you can not do much, its all technical stuff

@anna-geller anna-geller assigned Skraye and unassigned aj-emerich Feb 14, 2025
@anna-geller anna-geller added bug Something isn't working and removed enhancement New feature or request labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Needs frontend code changes bug Something isn't working kind/customer-request Requested by one or more customers kind/quick-win Seems to be quick to do
Projects
Status: Backlog
Development

No branches or pull requests

4 participants