TicketToJSON
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 src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Instructions]
style TextInput-7a156 stroke:#a170ff
ChatOutput-ol8bm[<div><img 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 src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-d3ck8 stroke:#a170ff
TextInput-cv9yq[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>ImageURL]
style TextInput-cv9yq stroke:#a170ff
DescribeImage-kmqoa[<div><img src="/_astro/image.segxnpQg.svg" style="height: 20px !important;width: 20px !important"/></div>Describe Image]
style DescribeImage-kmqoa stroke:#a170ff
ParseData-7m4sd[<div><img 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
🧩 Overview
The Ticket to JSON workflow automates the extraction of structured data from digital images of fast‑food restaurant post‑sale tickets. By combining a prompt‑based text instruction, an image URL, an OpenAI language model, and a series of transformation components, the system produces a JSON representation of the ticket contents and presents the result in a chat interface.
⚙️ Main Features
- Accepts a predefined extraction prompt and an image URL as input.
- Utilises an OpenAI language model to generate a natural‑language description of the image.
- Parses the description into plain text using a user‑defined template.
- Outputs the final JSON payload in a conversational chat.
- Supports easy substitution of the underlying language model.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Instructions | Provides the extraction prompt to guide the model. | None | Prompt Text |
| Image URL | Supplies the ticket image to be processed. | None | Image Data |
| OpenAI | Supplies a language model instance for image analysis. | Prompt Text, Image Data | Model (LanguageModel) |
| Describe Image | Generates a textual description of the image using the LLM. | Image Data, Prompt Text, LLM | Describe Data (Structured Description) |
| Description Extraction | Converts the description data into plain text using a template. | Describe Data, Template | Text (Parsed Output) |
| Chat Output | Displays the parsed text to the user in chat. | Text | Chat Message (JSON Output) |
🧠 Notes
- The workflow requires a publicly accessible image URL; it does not handle local file uploads.
- The extraction prompt is hard‑coded in the Instructions component but can be modified to target other document types.
- The OpenAI component can be configured to use any available OpenAI model (e.g., gpt‑4o, gpt‑5).
- JSON mode is disabled in the OpenAI component; the final JSON structure is constructed in the Description Extraction step.
- The system assumes internet connectivity for API calls and image retrieval.
- The Chat Output component presents the result as a chat message; it can be redirected to other interfaces if required.
- No internal IDs or configuration details are exposed in the documentation, ensuring clarity and privacy.