### Run Individual Step (Bash) Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt These bash commands demonstrate how to run or re-run a specific step in an AI flow session using cURL. You can provide additional input data and control whether dependent steps should also be executed. The examples show running a step with and without re-running dependencies. ```bash # Run a specific step with additional input curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/step/bakgrund" \ -H "Content-Type: application/json" \ -d '{ "input": "Focus on the historical context and previous implementations", "runRequiredSteps": false }' # Response: 201 Created # Location: /2281/session/550e8400-e29b-41d4-a716-446655440000/step/bakgrund # Re-run step and also re-run any required dependency steps curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/step/forvaltningens-overvaganden" \ -H "Content-Type: application/json" \ -d '{ "input": "", "runRequiredSteps": true }' ``` -------------------------------- ### API Response Structure Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt This JSON object represents the output of a completed step within the AI flow. It includes the step's ID, its final state, the generated output text, and timestamps for when the step started and finished. ```json { "stepId": "arendet", "state": "FINISHED", "output": "Ärendet handlar om att utvärdera en ny AI-baserad dokumenthanteringslösning...", "startedAt": "2024-01-15T10:30:00", "finishedAt": "2024-01-15T10:30:45" } ``` -------------------------------- ### Step Configuration with Dependencies (JSON) Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt This JSON defines the steps within a flow, including their order, visibility, and target service or assistant. It shows how steps can be configured to use flow inputs or the output from preceding steps, specifying how the data should be used. ```json { "steps": [ { "id": "initial-analysis", "name": "Initial Analysis", "order": 1, "visible": true, "target": { "type": "SERVICE", "id": "9dda859f-f7cf-4961-9616-cdcb1c8b3d85" }, "input": [ { "use-flow-input": "main-content" }, { "use-flow-input": "supporting-documents" } ] }, { "id": "detailed-review", "name": "Detailed Review", "order": 2, "visible": true, "target": { "type": "ASSISTANT", "id": "127dd187-b010-42db-a0b4-f413de22963f" }, "input": [ { "use-flow-input": "main-content" }, { "use-output-from-step": "initial-analysis", "use-as": "Previous Analysis" } ] }, { "id": "final-summary", "name": "Final Summary", "order": 3, "visible": true, "target": { "type": "APP", "id": "714e598a-7a73-4870-81e5-1b8c9e3897a3" }, "input": [ { "use-output-from-step": "initial-analysis", "use-as": "Analysis" }, { "use-output-from-step": "detailed-review", "use-as": "Review" } ] } ] } ``` -------------------------------- ### Create a New Workflow Definition Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Shows how to register a new workflow by sending a JSON payload to the POST endpoint. The payload defines the flow structure, input fields, and sequential steps with their respective AI service targets. ```bash curl -X POST "http://localhost:8080/2281/flow" \ -H "Content-Type: application/json" \ -d '{ "id": "my-custom-flow", "name": "Custom AI Flow", "description": "A custom workflow for document processing", "ttlInMinutes": 120, "defaultTemplateId": "custom.template", "input": [ { "id": "document-text", "type": "TEXT", "name": "Document Content", "optional": false }, { "id": "attachments", "type": "FILE", "name": "Attachments", "optional": true } ], "steps": [ { "id": "analyze", "name": "Analyze Document", "order": 1, "target": { "type": "SERVICE", "id": "9dda859f-f7cf-4961-9616-cdcb1c8b3d85" } }, { "id": "summarize", "name": "Generate Summary", "order": 2, "target": { "type": "SERVICE", "id": "127dd187-b010-42db-a0b4-f413de22963f" } } ] }' ``` -------------------------------- ### Generate Session Output (Bash) Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt These bash commands illustrate how to generate the final rendered output of an AI flow session. You can use the default template or specify a custom template ID. The response includes the rendered HTML content. ```bash # Generate output using default template curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/generate" \ -H "Content-Type: application/json" \ -d '{}' # Generate output using specific template curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/generate" \ -H "Content-Type: application/json" \ -d '{ "templateId": "ai-mvp.custom-template" }' # Response # { # "output": "... rendered document content ..." # } ``` -------------------------------- ### Manage Workflow Sessions Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Endpoints to create, retrieve, and delete workflow sessions. Creating a session initializes the state for a specific flow version, while retrieval provides the current execution status. ```bash # Create session curl -X POST "http://localhost:8080/2281/session" -H "Content-Type: application/json" -d '{"flowId": "tjansteskrivelse"}' # Get session curl -X GET "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000" -H "Accept: application/json" # Delete session curl -X DELETE "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000" ``` -------------------------------- ### Retrieve Flow Definitions via REST API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Demonstrates how to fetch all available flows, the latest version of a specific flow, or a specific version using cURL requests. These endpoints return JSON objects containing flow metadata, input requirements, and step configurations. ```bash # Get all flows curl -X GET "http://localhost:8080/2281/flow" -H "Accept: application/json" # Get latest version of a flow curl -X GET "http://localhost:8080/2281/flow/tjansteskrivelse" -H "Accept: application/json" # Get specific version of a flow curl -X GET "http://localhost:8080/2281/flow/tjansteskrivelse/1" -H "Accept: application/json" ``` -------------------------------- ### POST /session/{sessionId}/generate Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Generates the final rendered output from a completed session using a specified template or the flow's default template. ```APIDOC ## POST /session/{sessionId}/generate ### Description Generates the final rendered output from a completed session using a template. Uses the flow's default template if none is specified. ### Method POST ### Endpoint `/session/{sessionId}/generate` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session. #### Request Body - **templateId** (string) - Optional - The identifier of the template to use for rendering the output. ### Request Example ```json { "templateId": "ai-mvp.custom-template" } ``` ### Response #### Success Response (200 OK) - **output** (string) - The rendered document content. #### Response Example ```json { "output": "... rendered document content ..." } ``` ``` -------------------------------- ### POST /session/{sessionId}/step/{stepId} Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Runs or re-runs a specific step in a session. You can provide additional input and control whether dependent steps should also be re-run. ```APIDOC ## POST /session/{sessionId}/step/{stepId} ### Description Runs or re-runs a specific step in the session. Optionally provide additional input and control whether required dependent steps should also be re-run. ### Method POST ### Endpoint `/session/{sessionId}/step/{stepId}` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session. - **stepId** (string) - Required - The identifier of the step to run or re-run. #### Request Body - **input** (string) - Optional - Additional input for the step. - **runRequiredSteps** (boolean) - Optional - Whether to re-run required dependent steps. ### Request Example ```json { "input": "Focus on the historical context and previous implementations", "runRequiredSteps": false } ``` ### Response #### Success Response (201 Created) - **Location** (string) - The URL to the newly created or updated step resource. #### Response Example ``` /2281/session/550e8400-e29b-41d4-a716-446655440000/step/bakgrund ``` ``` -------------------------------- ### Manage Session Inputs Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Provides methods to add text or file inputs to a session, and to clear existing inputs. File uploads support multipart/form-data and include automatic processing for common document formats. ```bash # Add text input curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/input/uppdraget-till-tjansten/simple" -H "Content-Type: application/json" -d '{"value": "Example text"}' # Upload file curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/input/bakgrundsmaterial/file" -H "Content-Type: multipart/form-data" -F "file=@/path/to/document.pdf" # Clear input curl -X DELETE "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/input/bakgrundsmaterial" -H "Accept: application/json" ``` -------------------------------- ### Execute Workflow Steps Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Triggers the asynchronous execution of all steps within a session or retrieves the status of a specific step. Ensures all dependencies are met before processing. ```bash # Run session curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000" # Get step execution curl -X GET "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/step/arendet" -H "Accept: application/json" ``` -------------------------------- ### Session Execution API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Endpoints for running and monitoring session executions. ```APIDOC ## POST /session/:sessionId ### Description Executes all steps in a session asynchronously. All required inputs must have values before execution. Steps are executed in order, with dependent steps waiting for their dependencies. ### Method POST ### Endpoint `/session/:sessionId` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session to execute. ### Response #### Success Response (204 No Content) Indicates that the execution has started asynchronously. ## GET /session/:sessionId ### Description Polls the session to check its progress and the status of step executions. ### Method GET ### Endpoint `/session/:sessionId` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session to poll. ### Response #### Success Response (200 OK) - Returns the session object with updated state and step execution details. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "state": "RUNNING", "stepExecutions": { "arendet": { "state": "FINISHED", "output": "..." }, "bakgrund": { "state": "RUNNING" }, "forvaltningens-overvaganden": { "state": "PENDING" } } } ``` ## GET /session/:sessionId/step/:stepName ### Description Retrieves the current state and output of a specific step execution within a session. ### Method GET ### Endpoint `/session/:sessionId/step/:stepName` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session. - **stepName** (string) - Required - The name of the step to retrieve details for. ### Response #### Success Response (200 OK) - Returns the details of the specified step execution. ``` -------------------------------- ### Session Input API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Endpoints for adding and clearing input values for a session. ```APIDOC ## POST /session/:sessionId/input/:inputName/simple ### Description Adds simple text input to a session. For single-valued inputs, this replaces the previous value. ### Method POST ### Endpoint `/session/:sessionId/input/:inputName/simple` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session. - **inputName** (string) - Required - The name of the input field to update. #### Request Body - **value** (string) - Required - The text value to add to the input. ### Request Example ```json { "value": "Utvärdera möjligheten att implementera en ny AI-baserad dokumenthanteringslösning för kommunens förvaltningar." } ``` ### Response #### Success Response (200 OK) - Returns the updated session object. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "state": "CREATED", "input": { "uppdraget-till-tjansten": [ { "name": "Uppdrag", "value": "Utvärdera möjligheten..." } ] } } ``` ## POST /session/:sessionId/input/:inputName/file ### Description Uploads a file as input to a session. The service automatically removes images from PDF and DOCX files to reduce processing size. ### Method POST ### Endpoint `/session/:sessionId/input/:inputName/file` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session. - **inputName** (string) - Required - The name of the input field to update. #### Request Body - **file** (file) - Required - The file to upload. ### Request Example ```bash curl -X POST "http://localhost:8080/2281/session/550e8400-e29b-41d4-a716-446655440000/input/bakgrundsmaterial/file" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/document.pdf" ``` ### Response #### Success Response (200 OK) - Returns the updated session object with file reference. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "state": "CREATED", "input": { "bakgrundsmaterial": [ { "name": "Bakgrundsmaterial", "filename": "document.pdf", "contentType": "application/pdf" } ] } } ``` ## DELETE /session/:sessionId/input/:inputName ### Description Removes all values from a specific input field in the session. ### Method DELETE ### Endpoint `/session/:sessionId/input/:inputName` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session. - **inputName** (string) - Required - The name of the input field to clear. ### Response #### Success Response (200 OK) - Returns the updated session object with the cleared input. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "input": { "bakgrundsmaterial": [] } } ``` ``` -------------------------------- ### Flow Definition Structure Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Defines the structure of input types and step configurations for AI flows. ```APIDOC ## Flow Definition Structure ### Flow Input Types Flows support multiple input types that define what data users must provide before execution. ```json { "input": [ { "id": "case-number", "type": "STRING", "name": "Case Number", "description": "The official case reference number", "optional": true, "passthrough": true }, { "id": "main-content", "type": "TEXT", "name": "Main Content", "description": "The primary text content to process", "optional": false, "multipleValued": false }, { "id": "supporting-documents", "type": "FILE", "name": "Supporting Documents", "description": "PDF or DOCX files with additional context", "optional": true, "multipleValued": true } ] } ``` ### Step Configuration with Dependencies Steps can reference flow inputs directly or use output from previous steps as input. ```json { "steps": [ { "id": "initial-analysis", "name": "Initial Analysis", "order": 1, "visible": true, "target": { "type": "SERVICE", "id": "9dda859f-f7cf-4961-9616-cdcb1c8b3d85" }, "input": [ { "use-flow-input": "main-content" }, { "use-flow-input": "supporting-documents" } ] }, { "id": "detailed-review", "name": "Detailed Review", "order": 2, "visible": true, "target": { "type": "ASSISTANT", "id": "127dd187-b010-42db-a0b4-f413de22963f" }, "input": [ { "use-flow-input": "main-content" }, { "use-output-from-step": "initial-analysis", "use-as": "Previous Analysis" } ] }, { "id": "final-summary", "name": "Final Summary", "order": 3, "visible": true, "target": { "type": "APP", "id": "714e598a-7a73-4870-81e5-1b8c9e3897a3" }, "input": [ { "use-output-from-step": "initial-analysis", "use-as": "Analysis" }, { "use-output-from-step": "detailed-review", "use-as": "Review" } ] } ] } ``` ``` -------------------------------- ### Session Management API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Endpoints for creating, retrieving, and deleting workflow sessions. ```APIDOC ## POST /session ### Description Creates a new workflow session for a specific flow. Optionally specify a version; otherwise, the latest version is used. ### Method POST ### Endpoint `/session` ### Parameters #### Request Body - **flowId** (string) - Required - The ID of the flow for which to create a session. - **version** (integer) - Optional - The specific version of the flow to use. ### Request Example ```json { "flowId": "tjansteskrivelse", "version": 2 } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created session. - **municipalityId** (string) - The ID of the municipality. - **state** (string) - The current state of the session (e.g., CREATED, RUNNING). - **input** (object) - An object containing the input fields for the session. - **stepExecutions** (object) - An object detailing the status of each step in the workflow. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "municipalityId": "2281", "state": "CREATED", "input": { "uppdraget-till-tjansten": [], "forvaltningens-input": [], "bakgrundsmaterial": [] }, "stepExecutions": { "arendet": { "state": "PENDING" }, "bakgrund": { "state": "PENDING" }, "forvaltningens-overvaganden": { "state": "PENDING" } } } ``` ## GET /session/:sessionId ### Description Retrieves the current state of a session including all inputs and step execution statuses. ### Method GET ### Endpoint `/session/:sessionId` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the session. - **municipalityId** (string) - The ID of the municipality. - **state** (string) - The current state of the session. - **input** (object) - An object containing the input fields and their values. - **stepExecutions** (object) - An object detailing the status and output of each step execution. ### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "municipalityId": "2281", "state": "RUNNING", "input": { "uppdraget-till-tjansten": [ { "name": "Uppdrag", "value": "Utvärdera ny IT-lösning" } ] }, "stepExecutions": { "arendet": { "state": "FINISHED", "output": "AI-generated analysis of the case..." }, "bakgrund": { "state": "RUNNING" } } } ``` ## DELETE /session/:sessionId ### Description Deletes a session and cleans up any associated files. ### Method DELETE ### Endpoint `/session/:sessionId` ### Parameters #### Path Parameters - **sessionId** (string) - Required - The ID of the session to delete. ### Response #### Success Response (204 No Content) Indicates the session was successfully deleted. ``` -------------------------------- ### Flow Management API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt APIs for managing AI flow definitions, including retrieving, creating, and deleting flows. ```APIDOC ## GET /2281/flow ### Description Retrieves a list of all available workflow definitions with their summaries, including id, version, name, and description. ### Method GET ### Endpoint `/2281/flow` ### Parameters #### Query Parameters None #### Path Parameters None ### Request Example ```bash curl -X GET "http://localhost:8080/2281/flow" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the flow. - **version** (integer) - The version number of the flow. - **name** (string) - The display name of the flow. - **description** (string) - A brief description of the flow. #### Response Example ```json [ { "id": "tjansteskrivelse", "version": 2, "name": "Tjänsteskrivelse", "description": "Ett Intric AI-flöde för tjänsteskrivelser" }, { "id": "bildtolkare", "version": 2, "name": "Bildtolkare", "description": "AI-flöde för bildtolkning" } ] ``` ``` ```APIDOC ## GET /2281/flow/{flowId} ### Description Retrieves the complete definition of the latest version of a specific flow, including all inputs and steps. ### Method GET ### Endpoint `/2281/flow/{flowId}` ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow to retrieve. #### Query Parameters None ### Request Example ```bash curl -X GET "http://localhost:8080/2281/flow/tjansteskrivelse" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the flow. - **version** (integer) - The version number of the flow. - **name** (string) - The display name of the flow. - **description** (string) - A description of the flow. - **ttlInMinutes** (integer) - Time-to-live for the session in minutes. - **defaultTemplateId** (string) - The ID of the default template to use for output rendering. - **input** (array) - An array of input definitions for the flow. - **id** (string) - The ID of the input field. - **type** (string) - The data type of the input (e.g., TEXT, FILE). - **name** (string) - The display name of the input field. - **description** (string) - A description of the input field. - **optional** (boolean) - Whether the input is optional. - **multipleValued** (boolean) - Whether the input can accept multiple values. - **steps** (array) - An array of step definitions for the flow. - **id** (string) - The ID of the step. - **name** (string) - The display name of the step. - **order** (integer) - The order in which the step should be executed. - **visible** (boolean) - Whether the step is visible in the UI. - **target** (object) - The target service or AI model for the step. - **type** (string) - The type of target (e.g., SERVICE). - **id** (string) - The ID of the target service or model. #### Response Example ```json { "id": "tjansteskrivelse", "version": 2, "name": "Tjänsteskrivelse", "description": "Ett Intric AI-flöde för tjänsteskrivelser", "ttlInMinutes": 180, "defaultTemplateId": "ai-mvp.tjansteskrivelse", "input": [ { "id": "uppdraget-till-tjansten", "type": "TEXT", "name": "Uppdrag", "description": "", "optional": false, "multipleValued": false }, { "id": "bakgrundsmaterial", "type": "FILE", "name": "Bakgrundsmaterial", "description": "", "multipleValued": true } ], "steps": [ { "id": "arendet", "name": "Ärendet", "order": 1, "visible": true, "target": { "type": "SERVICE", "id": "9dda859f-f7cf-4961-9616-cdcb1c8b3d85" } } ] } ``` ``` ```APIDOC ## GET /2281/flow/{flowId}/{version} ### Description Retrieves a specific version of a flow definition by providing both flowId and version number. ### Method GET ### Endpoint `/2281/flow/{flowId}/{version}` ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow. - **version** (integer) - Required - The specific version number of the flow. #### Query Parameters None ### Request Example ```bash curl -X GET "http://localhost:8080/2281/flow/tjansteskrivelse/1" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - Returns the full flow definition for the specified version. Structure is identical to the response for `GET /2281/flow/{flowId}`. #### Response Example ```json { "id": "tjansteskrivelse", "version": 1, "name": "Tjänsteskrivelse", "description": "Ett Intric AI-flöde för tjänsteskrivelser", ... } ``` ``` ```APIDOC ## POST /2281/flow ### Description Creates a new flow definition. The system automatically assigns version numbers. Validates that the flow has no circular step dependencies. ### Method POST ### Endpoint `/2281/flow` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **id** (string) - Required - The unique identifier for the new flow. - **name** (string) - Required - The display name of the flow. - **description** (string) - Optional - A description of the flow. - **ttlInMinutes** (integer) - Optional - Time-to-live for the session in minutes. - **defaultTemplateId** (string) - Optional - The ID of the default template to use for output rendering. - **input** (array) - Required - An array of input definitions for the flow. - **id** (string) - Required - The ID of the input field. - **type** (string) - Required - The data type of the input (e.g., TEXT, FILE). - **name** (string) - Required - The display name of the input field. - **description** (string) - Optional - A description of the input field. - **optional** (boolean) - Optional - Whether the input is optional (defaults to false). - **multipleValued** (boolean) - Optional - Whether the input can accept multiple values (defaults to false). - **steps** (array) - Required - An array of step definitions for the flow. - **id** (string) - Required - The ID of the step. - **name** (string) - Required - The display name of the step. - **order** (integer) - Required - The order in which the step should be executed. - **visible** (boolean) - Optional - Whether the step is visible in the UI (defaults to true). - **target** (object) - Required - The target service or AI model for the step. - **type** (string) - Required - The type of target (e.g., SERVICE). - **id** (string) - Required - The ID of the target service or model. - **input** (array) - Optional - Defines how the step's input is populated, referencing flow inputs or outputs from previous steps. - **use-flow-input** (string) - References an input defined at the flow level. - **use-output-from-step** (string) - References the output from a previous step. - **use-as** (string) - Alias for the input when referencing a step output. ### Request Example ```json { "id": "my-custom-flow", "name": "Custom AI Flow", "description": "A custom workflow for document processing", "ttlInMinutes": 120, "defaultTemplateId": "custom.template", "input": [ { "id": "document-text", "type": "TEXT", "name": "Document Content", "description": "The main document text to process", "optional": false, "multipleValued": false }, { "id": "attachments", "type": "FILE", "name": "Attachments", "description": "Supporting files", "optional": true, "multipleValued": true } ], "steps": [ { "id": "analyze", "name": "Analyze Document", "order": 1, "visible": true, "target": { "type": "SERVICE", "id": "9dda859f-f7cf-4961-9616-cdcb1c8b3d85" }, "input": [ { "use-flow-input": "document-text" }, { "use-flow-input": "attachments" } ] }, { "id": "summarize", "name": "Generate Summary", "order": 2, "visible": true, "target": { "type": "SERVICE", "id": "127dd187-b010-42db-a0b4-f413de22963f" }, "input": [ { "use-output-from-step": "analyze", "use-as": "Analysis" } ] } ] } ``` ### Response #### Success Response (201 Created) - **Location** header contains the URL to the newly created flow (e.g., `/my-custom-flow/1`). #### Response Example ``` HTTP/1.1 201 Created Location: /my-custom-flow/1 ``` ``` ```APIDOC ## DELETE /2281/flow/{flowId}/{version} ### Description Deletes a specific version of a flow. If no version is specified, it deletes the entire flow and all its versions. ### Method DELETE ### Endpoint `/2281/flow/{flowId}/{version}` or `/2281/flow/{flowId}` ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow to delete. - **version** (integer) - Optional - The specific version number of the flow to delete. If omitted, the entire flow is deleted. #### Query Parameters None ### Request Example ```bash # Delete a specific version of a flow curl -X DELETE "http://localhost:8080/2281/flow/tjansteskrivelse/1" # Delete an entire flow and all its versions curl -X DELETE "http://localhost:8080/2281/flow/my-custom-flow" ``` ### Response #### Success Response (204 No Content) - Indicates that the flow or flow version was successfully deleted. #### Error Response (404 Not Found) - If the specified flow or version does not exist. ``` -------------------------------- ### Delete Flow Versions Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Deletes either all versions of a specific flow or a single version by providing the version number. Requires the flow ID and optional version identifier. ```bash curl -X DELETE "http://localhost:8080/2281/flow/my-custom-flow" curl -X DELETE "http://localhost:8080/2281/flow/my-custom-flow/1" ``` -------------------------------- ### Flow Input Types Definition (JSON) Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt This JSON structure defines the types of inputs a flow can accept from users. It specifies properties like ID, type (STRING, TEXT, FILE), name, description, and whether the input is optional or can accept multiple values. ```json { "input": [ { "id": "case-number", "type": "STRING", "name": "Case Number", "description": "The official case reference number", "optional": true, "passthrough": true }, { "id": "main-content", "type": "TEXT", "name": "Main Content", "description": "The primary text content to process", "optional": false, "multipleValued": false }, { "id": "supporting-documents", "type": "FILE", "name": "Supporting Documents", "description": "PDF or DOCX files with additional context", "optional": true, "multipleValued": true } ] } ``` -------------------------------- ### Flow Deletion API Source: https://context7.com/sundsvallskommun/api-service-ai-flow/llms.txt Endpoints for deleting all versions of a flow or a specific version of a flow. ```APIDOC ## DELETE /flow/:flowId ### Description Deletes all versions of a specified flow. ### Method DELETE ### Endpoint `/flow/:flowId` ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. ## DELETE /flow/:flowId/:version ### Description Deletes a specific version of a flow. ### Method DELETE ### Endpoint `/flow/:flowId/:version` ### Parameters #### Path Parameters - **flowId** (string) - Required - The ID of the flow. - **version** (integer) - Required - The version number of the flow to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.