Build and run Workflows

Workflows run a sequence of Actions and pass values between blocks. Each Workflow belongs to one App, records its runs, and can be triggered from the builder, a bulk table, a CSV file, a cron schedule, the API, or the Python SDK.


Prerequisites and availability

You need:

  • Membership in the workspace.
  • An App containing at least one saved Action.
  • Valid LLM provider connections for every Action in the Workflow.
  • A workspace API key when you trigger or inspect Workflows from code.

Workflows are controlled by the workspace's workflows feature flag. If Add Workflow does not appear on the App overview, the feature is not enabled for that workspace. The current app allows authenticated workspace members to create, edit, run, schedule, rename, and delete Workflows when the feature is available.


Create a Workflow

  1. Open an App.
  2. Select Add Workflow.
  3. Enter a Workflow Name in Create a new Workflow.
  4. Select Save.

Klu creates the Workflow and opens its detail page. The top bar shows its name and GUID. Use the GUID for API and SDK calls.


Build the block sequence

Open the Build tab.

  1. Select Add block.
  2. Choose Block Type: Standard.
  3. Choose an Action from the current App.
  4. Fill the Action's prompt variables for this block.
  5. Add more blocks and drag them into execution order.
  6. Reference previous block values with the variable picker or template syntax such as {{blocks.[0].output}}.
  7. Add a Block Type: Output when you want to shape the Workflow's final response from earlier outputs.
  8. Select Save.

Standard blocks run Actions. Output blocks interpolate the final result; they do not select an Action. You can select New Action from the Workflow top bar or Edit beside a selected Action without leaving the builder.

The builder stores the current block inputs as Workflow values. These values become the input keys shown by API/SDK Details and can be overridden when a caller triggers the Workflow.

Save and test behavior

  • Save persists the current blocks and stored values. It is disabled when the Workflow has no blocks.
  • Run Workflow runs the blocks currently shown in the builder and opens a Workflow run drawer with the result. This test path can execute the current block arrangement before you save it.
  • Command-S saves. Command-Shift-R runs the Workflow from the builder.
  • A Workflow with no blocks cannot be saved, published through API/SDK Details, or run from the top bar.
  • If the App has no Actions, the builder displays You have no actions in this app. Create an Action before continuing.

Each Action can still fail independently because of model credentials, prompt inputs, Context, Skill calls, or provider limits. The builder reports the run error and leaves the Workflow available for correction and another run.


Run multiple inputs

Use Bulk

Open Bulk to edit a table of inputs generated from the Workflow's Action variables. Add one row for each run, then select Run Workflow.

Klu converts each row to a Workflow input object and triggers the batch. The page previews up to three resulting data records and links to View full workflow output in the App's Data page.

Use CSV

Open CSV and select Add CSV. The first row must contain the generated Workflow input keys; each later row supplies values for one run. Use Example CSV to download the exact headers for the saved Workflow, inspect the parsed table, then select Run Workflow.

The UI reports CSV file is too large. Max 1000 rows when the parsed file exceeds 1,000 rows. The current handler still loads that data after showing the warning, so keep the file below the stated limit. The parser splits lines and fields on newline and comma characters directly; quoted commas and multiline CSV fields are not parsed as structured CSV. Keep values simple or use Bulk/API input for complex strings.


Schedule a Workflow

Open Schedule to create one cron trigger.

  1. Enter a five-field Cron Expression, such as 0 9 * * 1-5.
  2. Review the next three displayed execution times.
  3. Select Save.

The preview evaluates the schedule in the Europe/London time zone. The saved schedule displays as its raw cron expression. Use Delete to remove the schedule.

An invalid expression displays Cron is invalid. Format should be: */5 * * * * and cannot be saved. Scheduled runs depend on the saved Workflow configuration and the background task system; verify the first expected run in History.


Trigger a Workflow through the API

Select API/SDK Details in the Workflow top bar to copy the Workflow GUID and view generated examples. Create a workspace API key under SettingsAPI Keys first.

cURL

curl --request POST 'https://api.klu.ai/v1/workflows/YOUR_WORKFLOW_GUID/trigger' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "input": {
      "blocks.[0].input": "Summarize this customer request"
    }
  }'

Use the input keys generated for your own Workflow. Action variables use keys such as blocks.[0].customer_request; Actions without named variables use blocks.[0].input.

The Python SDK exposes the current Workflow lifecycle endpoints:

Run and inspect a Workflow

import asyncio

from klu import Klu


async def main() -> None:
    klu = Klu("YOUR_API_KEY")
    workflow_guid = "YOUR_WORKFLOW_GUID"

    response = await klu.workflows.run(
        workflow_guid,
        {"blocks.[0].input": "Summarize this customer request"},
    )
    print(response.status, response.msg)

    runs = await klu.workflows.get_runs(workflow_guid)
    if runs:
        run_guid = runs[0].guid
        result = await klu.workflows.get_run_result(workflow_guid, run_guid)
        dataset = await klu.workflows.get_run_result_dataset(workflow_guid, run_guid)
        print(result)
        print(dataset.final, dataset.blocks)


asyncio.run(main())

The Python client can list Workflows, trigger one, list its runs, fetch a final result, and fetch a run dataset containing the final value plus block results. Create, get, update, and delete methods are unsupported in the current Python client.

The Workflow dialog currently displays a TypeScript SDK example, while the current public @kluai/core Klu class has no workflows client. Use the HTTP endpoint or Python SDK for programmatic Workflow runs.

See API and SDK basics for installation and authentication.


Monitor runs

Open History to see the five most recent runs. Each row shows:

  • The run GUID and number of generated data points.
  • Creation date and time.
  • The workspace user who triggered it, or API for an external trigger.
  • An export action.
  • An overview drawer containing the run's generated data.

Use the App's Data page when you need all output records or richer filtering. From the Python SDK, use get_runs, get_run_result, and get_run_result_dataset when you need automated monitoring or per-block results.


Rename or delete a Workflow

Open Settings to change the Workflow name. The Danger Zone contains the delete control.

Deleting a Workflow removes it from the App and stops future direct or scheduled use. Treat its GUID as invalid after deletion, remove any external callers, and clear its schedule before deleting when operational ownership is shared.