New to Kestra?
Use blueprints to kickstart your first workflows.
Search OpenAlex from a Kestra webhook or manual input, inspect matches with DuckDB, and export up to 25 scholarly works to CSV.
Find related papers with the public OpenAlex Works API and turn the results into a small, reusable research dataset. Run the flow manually with a search query, or POST a query to its keyed webhook. Kestra downloads the API response, DuckDB checks the total match count, flattens the returned works, and writes a spreadsheet-ready CSV artifact.
search_webhook (io.kestra.plugin.core.trigger.Webhook) accepts a JSON request body with a query string. The key comes from the OPENALEX_WEBHOOK_KEY Kestra secret.download_works (io.kestra.plugin.core.http.Download) calls https://api.openalex.org/works with OpenAlex's search, per_page, and select parameters. The response is limited to 25 works and five useful fields; this basic API request does not need an OpenAlex API key.count_matches (io.kestra.plugin.jdbc.duckdb.Query) reads meta.count from the downloaded JSON. check_for_results (io.kestra.plugin.core.flow.If) logs either the total match count or that the search was empty.shape_results uses DuckDB's JSON table function to flatten the first page into one row per work, ordered by citation count and publication date, and writes the results directly to the openalex-results.csv artifact. DuckDB includes the column header even when a search returns no rows.openalex_id, title, doi, publication_date, and cited_by_count.{{ outputs.csv_uri }} flow output and {{ outputs.shape_results.outputFiles['openalex-results.csv'] }} task artifact path for downloading the CSV.Use the same observable flow from the Kestra UI or a keyed webhook. Kestra connects the API request, result-count check, and DuckDB transformation, then keeps the task logs and CSV artifact with the execution.
api.openalex.org.OPENALEX_WEBHOOK_KEY: a caller-chosen secret value used in the webhook URL. It is required for webhook calls; manual UI executions only need the search_query input.search_query input (STRING, default workflow orchestration), or add OPENALEX_WEBHOOK_KEY to your Kestra secrets and use the webhook trigger.{"query": "workflow orchestration"}. A non-empty query value overrides the manual input; an empty or whitespace-only value uses search_query.shape_results task artifact or the flow output csv_uri to download the CSV.select parameter and the DuckDB query to include more work metadata in the CSV.per_page to export a different number of works, or add OpenAlex filters for a narrower search.