OpenAI Document Parser v2
Provides integration with OpenAI models, which can interpret document content and produce structured text or JSON from natural-language instructions.
The Flowgear OpenAI Document Parser Node generates schemas and validation scripts or parses documents into structured JSON for Workflow use.
Revision History
0.0.0.1 - Added the OpenAI Document Parser Node with schema generation, validation script generation, structured parsing, Connection settings, and templates.
0.0.0.4 - Updated templates and embedded the Node icon.
0.0.0.6 - Allowed documents to be parsed without supplying a schema.
0.0.0.8 - Updated template behavior and validation script handling.
0.0.0.9 - Maintenance release.
0.0.0.13 - Split the Node into dedicated CreateSchema, CreateValidationScript, and ParseDocument methods, and fixed templates and icon behavior.
0.0.0.16 - Maintenance release.
Connection
The Connection stores the OpenAI API key and model name used by every method.
| Property | Type | Description |
|---|---|---|
API Key |
Masked | OpenAI API key used to authenticate requests. |
Model |
String | OpenAI model name used for document parser requests, for example gpt-4.1. |
Setup Notes
- Configure an OpenAI API key with access to the model selected in the
Connection. - The Node validates that
API KeyandModelare provided before each request. - The
Connectiontest validates the configured model through the OpenAI models endpoint. - The Node is designed for PDF documents. Provide document content as a stream and pass a
DocumentNamethat includes the file extension, for exampleinvoice.pdf. Documents with a.pdfextension are sent to OpenAI as PDF content.
Methods
The Node exposes separate methods for schema generation, validation script generation, and document parsing.
CreateSchema
Generates a JSON schema that models the supplied document structure.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | OpenAI API key and model configuration. |
DocumentName |
String | Source document file name, including extension. Required. |
Document |
Stream | Source PDF document content stream. Required. |
CustomProperties |
Object | Optional prompt hints applied during schema generation. |
| Return | Type | Description |
|---|---|---|
Response |
Object | The schema-generation result. |
Response.schema |
Object | Generated JSON schema. |
CreateValidationScript
Generates a C# validation script for a supplied schema and document context. The generated script must include a Validate method.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | OpenAI API key and model configuration. |
Schema |
String | JSON schema that the generated script should validate. Required. |
DocumentName |
String | Source document file name, including extension. Required. |
Document |
Stream | Source PDF document content stream. Required. |
CustomProperties |
Object | Optional prompt hints applied during script generation. |
| Return | Type | Description |
|---|---|---|
Response |
Object | The validation-script generation result. |
Response.validationScript |
String | Generated C# validation script. |
ParseDocument
Parses the supplied document into structured JSON, optionally guided by a schema and validation script. For repetitive jobs or large volumes, a schema is recommended to ensure a predictable response format.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | OpenAI API key and model configuration. |
DocumentName |
String | Source document file name, including extension. Required. |
Document |
Stream | Source PDF document content stream. Required. |
Schema |
String | Optional JSON schema describing the expected output. |
ValidationScript |
String | Optional C# validation script included with the parse request. When supplied, it must define a Validate method. |
CustomProperties |
Object | Prompt hints and optional dot-path validation assertions. |
| Return | Type | Description |
|---|---|---|
Response |
Object | The document-parsing result. |
Response.parsedDocument |
Object | Parsed document in JSON format. |
Usage Notes
DocumentNameandDocumentare required for all methods.Schemais required forCreateValidationScriptand optional forParseDocument.ValidationScript, when provided, must include a C#Validatemethod. The Node checks the method contract but does not execute the script locally.CustomPropertiescan add prompt guidance withprompt.schema.append,prompt.script.append,prompt.parse.append, orprompt.system.append.- For
ParseDocument, non-prompt.custom property keys are treated as dot-path assertions against the parsed output. A failed assertion raises an error. - All methods return a single
Responseobject. Alongside the method-specific payload,Responseincludesstatus(OKorERROR),statusMessagewith the provider or operation state, anderrorMessagewhen the operation cannot complete.