Actions6
Classify a Document
AI-generatedSummary
Classifies each document into one of the categories you define, using the category labels and descriptions as classification rules. Provide the document as binary data or reference a file already uploaded to the LlamaParse Platform.
Inputs
- Rules (required) — Add one or more categories, each with a required short Category label and plain-language Description. The node sends these as the classification rules.
- Input Type — Choose Binary File (the default) or File ID.
- Input Data Field Name (required) — For Binary File input, the name of the incoming item's binary property containing the document. Defaults to data; the node uploads this file before classification.
- File ID (required) — For File ID input, the ID of a file previously uploaded using the Upload a File action.
Output shape
One output item per input document, containing a single JSON object.
The object has category, reasons, and confidence fields. If the result has no category, category is set to "unclassified". The node waits for the classification job to complete; job failures or missing classification results raise an error, or produce an error field if Continue On Fail is enabled.
Examples
Example 1: Classify an uploaded document using rules for invoices and contracts.
Add an invoice rule and a contract rule, each with a description. Set Input Type to File ID and provide the uploaded file's ID, or use Binary File and specify the binary field name.