Ticket to JSON Converter
This flow, called "Ticket to JSON", has the main goal of extracting detailed information from a ticket and structuring that data in JSON format.
+2
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
TextInput-7a156[<div><img alt="logo" src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Instructions]
style TextInput-7a156 stroke:#a170ff
ChatOutput-ol8bm[<div><img alt="logo" src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-ol8bm stroke:#a170ff
OpenAIModel-d3ck8[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-d3ck8 stroke:#a170ff
TextInput-cv9yq[<div><img alt="logo" src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>ImageURL]
style TextInput-cv9yq stroke:#a170ff
DescribeImage-kmqoa[<div><img alt="logo" src="/_astro/image.segxnpQg.svg" style="height: 20px !important;width: 20px !important"/></div>Describe Image]
style DescribeImage-kmqoa stroke:#a170ff
ParseData-7m4sd[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>DescriptionExtraction]
style ParseData-7m4sd stroke:#a170ff
OpenAIModel-d3ck8 -.- DescribeImage-kmqoa
linkStyle 0 stroke:#a170ff
TextInput-7a156 -.- DescribeImage-kmqoa
linkStyle 1 stroke:#a170ff
DescribeImage-kmqoa -.- ParseData-7m4sd
linkStyle 2 stroke:#a170ff
ParseData-7m4sd -.- ChatOutput-ol8bm
linkStyle 3 stroke:#a170ff
TextInput-cv9yq -.- DescribeImage-kmqoa
linkStyle 4 stroke:#a170ff
Ticket to JSON Converter
đź§© Overview
The Ticket to JSON Converter automates the extraction of structured information from a visual ticket. By leveraging an AI model to interpret the image and transform the results into a JSON object, the workflow eliminates manual data entry and reduces error risk.
⚙️ Main Features
- Accepts a text prompt defining extraction rules and an image URL in a single flow.
- Uses a configurable OpenAI model to generate a natural‑language description of the ticket contents.
- Parses the model output into a clean JSON structure following the provided schema.
- Returns the final JSON via a chat‑style output for immediate display or downstream consumption.
- Supports modular configuration of model parameters, prompt wording, and output formatting.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Text Input (Instructions) | Provides the extraction prompt that guides the AI. | Instruction text describing ticket format and required fields. | Prompt text for the next component. |
| Text Input (Image URL) | Supplies the image to be processed. | URL pointing to the ticket image. | Image reference passed to the image‑analysis step. |
| OpenAI Model | Generates a natural‑language description of the ticket using the configured LLM. | Model name, prompt text, and image reference. | Structured description of the image content. |
| Describe Image | Feeds the image and prompt to the AI model, producing a descriptive text. | Image data, prompt, and LLM reference. | Data object containing the image description. |
| Parse Data | Formats the description into a plain‑text message using a template. | Image description, template string, and separator. | Text representation of the parsed information. |
| Chat Output | Presents the final JSON to the user or downstream system. | Parsed text (JSON string). | Displayed message containing the structured data. |
đź§ Notes
- The OpenAI model requires a valid API key and may incur usage costs depending on token consumption.
- The image URL must be publicly accessible; otherwise, the describe image component will fail to fetch the content.
- The prompt supplied in the first Text Input must explicitly include the JSON structure expected in the final output; otherwise, the AI may produce non‑JSON text.
- The workflow assumes the ticket image contains clear, legible text; heavily distorted or low‑resolution images may lead to incomplete extraction.
- The Chat Output component displays the result as a simple chat message; additional post‑processing steps can be added if integration with other systems is required.