#Call a Flow from your application
Let an application supply a customer request and consume the classifier's queue suggestion. The application uses the host's public client. The method keeps its own implementation behind the FLOW boundary.
This tutorial continues Run your first Flow.
Use its reviewed support-demo project, the globally installed jig command, and Node 24.
The classifier and its keyword rules remain illustrative.
#Install the application client
From the project directory, install the published Jig package for the application:
Keep the generated lockfile.
The application imports @jigging/jig/client.
Each Flow retains its own SDK declaration.
Review the project and any changed dependencies before invoking it:
Inspect the proposal and approve the intended revision. The application below invokes that already approved work.
#Make one application call
Save this as app.mjs in the project directory:
The request allows 30 seconds and 64 KiB of result data.
This example supplies no files and requests no retained artifacts.
inspect() reads the target's approval.
run() coordinates preparation, submission, and completion.
result() reads retained output without running the method again.
Run the application:
Expected output:
The caller checks execution, cleanup, the method's outcome, and its output before using the suggestion. Those checks remain useful if the implementation later uses Agent instructions or combines other methods. This client belongs to Jig. The FLOW SDK serves method handlers, and each host supplies its own application interface.
#Supply another request
Change the input without changing the method:
The application prints Suggested queue: technical.
It can now present that suggestion for review or apply its own routing policy.
The example leaves that consequence with the application.
#Handle invalid input
Try the method's failure path:
The method rejects this input, and the application reports Execution failed: INVALID_INPUT.
It receives no queue suggestion to use.
Correct the input before starting another invocation.
Other failures can leave execution or cleanup unresolved.
The client exposes code, operation, and uncertain on AttemptClientError.
Inspect the attempt's evidence before deciding what should happen next.
#Keep recovery with the application
This example makes one joined call.
Durable applications must save the prepared request before submission so they can recover its identity after interruption.
Use client.run(request, { persist }) to await your application's transaction before launch.
The Jig application contract explains tickets, cancellation, retained results, and recovery.
Next, compose methods or adapt a Skill without changing the caller's result boundary.