Kissflow DocsHelp center

Run an agent from your systems

Start a published agent from an external service, keep its run ID, and read the results safely.

Call a published Kissflow agent from your own service to analyze business information and return structured results. You will authenticate with an access key, start a run, save its ID, and read that run until it finishes. Use the Agent API reference for the route, input and error tables.

Video: Run an agent from your systems

Prepare access

  1. Build the agent in AI Builder, test it, and click Generate in development, then deploy the app to the environment your service will call.
  2. Give the user or service account that owns the access key App Admin, Edit, or View permission on the app. View is sufficient to start a published run.
  3. Collect the target environment's base URL, account ID, app ID, and agent ID.
  4. Store the access-key ID and secret in your service's secret storage. Send them as X-Access-Key-Id and X-Access-Key-Secret headers.

The key identifies who starts the run. It does not replace an agent tool's connection. Each tool uses its saved connection account and that account's permissions.

Start the work once

Send an HTTP POST to the agent's execute endpoint with an InputData object. The keys inside that object must match the configured agent inputs. Text, Number, and Yes/No values must match the input types. See the Agent API for curl examples with placeholders.

A successful start returns HTTP 202 with ExecutionId and Status. Save the execution ID before proceeding. Associate it with your own request ID so a later worker or service restart can read the existing run.

Important

A 202 response acknowledges a background run. It does not include a finished answer. Agent runs do not retry automatically, and starting another run can repeat tool actions.

Read the existing run

  1. Call the run's GET endpoint using the saved execution ID and the same account, app, and agent context.
  2. If the Status is Queued, NotStarted, or Running, keep the ID and read it again later. Space reads to respect standard Kissflow API rate limits.
  3. If the run is Completed, validate the returned output ({"items":[{...}]}) fields and save the findings your system needs.
  4. If the run is Failed, record the reported error code and inspect any business records its tools may have changed. Failed runs return no partial results.

The API reports whether trying again could help. Treat that information as a reason to review the failure, rather than an instruction to resend automatically. A failed analysis can still have performed a tool action.

Handle an uncertain start

If your service loses the start response but already has the run ID, read that run before doing anything else. If it never received an ID, it cannot use the single-run GET endpoint to identify the run. List the agent's runs with GET .../execution?PageNumber=1&PageSize=20 (newest first, up to 50 per page) and check the affected business records before choosing to submit again. App Admins and Editors can read all agent runs; other users can read their own.

Do not assume the API deduplicates repeated starts. Keep automatic POST retries disabled in your client. If the API refuses requests with KISSFLOW_ERROR_15009, wait 30 seconds, then try again, but review the request state before proceeding.

Check the target environment

Only the published agent moves with an app deployment. Connection credentials are not transferred. Existing target connections keep their credentials. A missing connection becomes a placeholder, the agent still imports, and that tool fails until you connect it in the target environment. Run history stays in each environment. POST .../execute runs the Live version; use POST .../test to try the Draft in development. Verify that your service calls the intended environment and that its agent tools work there before enabling production requests.

On this page