Guides
Learn how to use Smole's features effectively.
Processing Documents
Upload documents with a schema ID to extract structured data. See Schemas for how to create and manage schemas, and Configuration for processing options and supported formats.
curl -X POST https://api.smole.tech/api/pipeline/file \
-H "X-API-Key: smole_your_api_key" \
-F "file=@receipt.pdf" \
-F "schemaId=your_schema_id"The response includes a job ID. Poll /api/pipeline/:id until the status is completed. See API Reference for all pipeline endpoints.
Checking Job Status
Jobs go through several statuses during processing:
pending- Job queued for processingconverting- Document being converted to Markdownextracting- AI extracting data from Markdowncompleted- Extraction finished, result availablefailed- Error occurred, check error field
Understanding Results
When a job completes, the result field contains the extracted JSON matching your schema. Fields that couldn't be found in the document are returned as null. See Missing Data and Null Values for details.
{
"status": "completed",
"result": {
"companyName": "Acme Corp",
"invoiceNumber": "INV-2024-001",
"purchaseOrder": null,
"total": 1250.00,
"lineItems": [
{ "description": "Consulting", "quantity": 10, "unitPrice": 125.00 }
]
}
}Tip: A null value means the data wasn't found in the document. This is more reliable than a guessed value, so you can flag nulls for manual review if needed.
Reviewing and downloading results
Upload one or more files in the Playground and choose Extract. Processing adapts automatically to the number of documents. The Playground opens completed documents in Results: labeled fields, nested sections and tables for lists such as line items. Expand a nested section to inspect its fields; the first non-empty list opens automatically. Missing values appear as “Not found”. Choose JSON to see the original structured result, or Document text to read and download the converted source as a Markdown (.md) file when it is still available.
- Open Download to choose Excel, CSV or JSON. Copy and remove actions appear on hover or keyboard focus on desktop and remain visible on touch screens.
- Excel (.xlsx) downloads contain a Documents sheet and separate sheets for nested lists.
- CSV downloads produce one .csv file for a single table, or a .zip archive of CSV files when the result has multiple tables.
- Document and row IDs link nested rows to their source. Field paths preserve nested names; blank cells represent missing values.
- Copy fields or Copy table pastes data into your spreadsheet. JSON (.json) downloads preserve the exact structured result, including the original field names and values.
- Select any completed document to review or download it while the remaining batch is still processing. Batch downloads include completed documents only; failed and cancelled jobs are excluded. Recent results lists your documents that ran without a workflow: those extracted in the Playground and those sent through the API with a schema. They have the same views and download options; a workflow's runs are on the workflow's page.
Views and downloads use the existing result, with no reprocessing or extra charge. The API returns JSON only; Excel and CSV are Playground download formats.
Connected sources and outputs
A workflow gets its documents from the API and from connected sources. A source brings documents in by itself, and an output sends results on by itself. Both belong to the workspace, and each can be linked to several workflows. The Connections page lists them all, with the workflows each one is linked to. Only workspace owners and admins can see and change connected sources and outputs.
Connected sources and the Connections page come with the workflow page that reads left to right: Sources, Smole, Outputs. If your workflow page has an Integrations section instead, your account does not have them yet: webhooks and Google Sheets are added in that section, and Google accounts are under Account, Connections.
- Sources: a Google Drive folder (new files in a folder run by themselves) or an Email inbox (mailed attachments run by themselves).
- Outputs: a Webhook (a signed event for each finished run) or a Google Sheet (one row per completed run).
- Every run is also kept under Results on the workflow's page, whether its document was sent with the API or came from a connected source.
Adding and linking
- Open a workflow. Its page reads left to right: Sources, Smole, Outputs.
- Choose Add source or Add output. Under Create new, pick a kind and fill in its form. Under Link a connected source or Link a connected output, pick one the workspace already has.
- A new source is created paused. Nothing is read or processed until you choose Enable. An output is active as soon as it is saved.
- To use the same source or output in another workflow, link it there too, or choose Link a workflow on its page under Connections.
A workflow can have at most 5 sources and 5 outputs. One Google Sheet can serve at most 10 workflows. A workspace can hold 1,000 sources and outputs.
What a source costs
- Each file runs once in every linked workflow and is billed once for each. A file in a source that feeds two workflows is two runs.
- Each run is billed like any other document. Failed runs are not charged. Sending results to an output, Send test, connecting an account and checking a folder are free.
- A source with no linked workflow runs nothing.
- A workflow linked later receives only files that arrive after the link. One case differs: when you link the first workflow to a source that is already enabled, Smole asks first: “Files already waiting in this source will be processed now.” For a Google Drive folder, the files that waited in the folder then run. Mail that arrived at an inbox meanwhile does not run by itself: choose Retry on its row.
What limits a source
A source has no limit of its own. Files run until your plan's documents are used up; on Growth, only a monthly budget you set under Account → Usage caps the cost.
- Free: five documents a day. The rest wait until midnight UTC, or run within about a minute of moving to a paid plan.
- Starter: when the month's documents are used up, the source pauses. It resumes by itself when the plan's next month starts, and the files that waited run first. Where the app offers the move to Growth, the source also asks you to upgrade, and resumes by itself after the upgrade.
- Growth: no limit. A monthly budget you set under Account → Usage pauses the sources when it is reached, and they resume by themselves when you raise or remove it, or when the next billing month starts.
- At the Starter limit, the workflow's page and the Connections page say so at the top, whether or not a file has arrived.
- While a source is paused by your plan it shows neither Pause nor Resume: it starts again by itself, and the files that waited run first. If you do not want them to run, unlink the workflow or delete the source before you upgrade or before the month renews.
- A source whose last 20 files all failed is paused, on every plan. Check the files or the workflow, then choose Resume.
Stopping and undoing
- Pause stops a source for every workflow it feeds. Files that arrive wait, and run after you resume.
- Unlink stops it for one workflow. Files that arrive from now on no longer run in that workflow, and runs already started finish. The source or output itself is kept, and keeps working for its other workflows.
- Delete source or Delete output removes it from every workflow and cannot be undone. Both are on the connection's own page: choose Open connection in its panel, or open it from Connections. Files that are still waiting are not processed.
Import from Google Drive
In the Playground, Import from Google Drive sits under the drop area, next to choosing files from your device. It adds files from your Google Drive to the list, where they are extracted like uploaded files: the same schema, the same price, the same results. Imported files do not run in a workflow. To have the files of a folder run in a workflow by themselves, set up a watched Google Drive folder.
If the Playground shows no such button, importing is not switched on for your account yet.
- Importing needs a Google account that you connected yourself; one that another member connected does not work for you. Without one, the button offers Connect Google. You leave the page to connect and come back to it. Files already in the list will have to be added again.
- Sign in to Google in this browser as that account first. Google's file picker shows the files of the Google account the browser is signed in to. If it shows a sign-in page instead, sign in to Google in another tab, then choose Import again.
- Choose Import from Google Drive and pick the files. The list holds up to 20 files, of at most 50 MB each.
- Choose a schema and extract, as for uploaded files.
What is not imported
- Google Docs, Sheets and Slides cannot be imported: download them as PDF first.
- A folder cannot be picked here.
- A file over 50 MB, or one that could not be downloaded (its owner does not allow it, Google blocked it, or the connection failed), is not added, and the page says why. Nothing is charged for a file that was not added.
What Smole can access
- The only Google Drive permission Smole asks for is
drive.file. It covers files Smole creates, and files and folders you pick. The permission also allows changing, deleting and sharing those files. For an import, Smole only downloads the files you pick. - To open Google's file picker, a short-lived access token (valid for about an hour at most) is sent to your browser and handed to Google's file picker. Smole's page keeps it in memory only and does not save it in the browser.
- Your browser downloads the picked files from Google and adds them to the list. From there they are uploads: Smole receives them when you extract, and stores them like any uploaded document: the stored copy is scheduled for automatic deletion once it is 30 days old, with a seven-day recovery window in storage, and the results and the text read from the file stay in your account.
- Smole keeps no list of the files you picked. At Google, a picked file stays covered by Smole's permission for that Google account, and is covered again if you connect the account again later.
- Picking files is free. You pay for the extractions, as for uploads.
Stopping and undoing
- Remove a file from the list before you extract, and it is never processed.
- To end the access, remove Smole in your Google Account settings, or choose Disconnect next to the Google account where the workspace's Google accounts are listed: the Connections page, or Account, Connections where the app bar has no Connections entry. Disconnect also asks Google to end the permission, unless another Smole workspace is connected to the same Google account. Both also stop the Google Sheets and watched folders that work through that account.
Watched Google Drive folder
Smole watches one folder. Files added to this Google Drive folder run by themselves, in every linked workflow. Smole checks the folder about every 5 minutes. Results appear under Results on the workflow's page and go to its outputs.
If your workflow page has an Integrations section and no Sources lane, your account does not have connected sources yet.
Setting it up
- On a workflow page choose Add source, then Google Drive folder. Or choose New source on the Connections page and link a workflow afterwards.
- Choose the Google account. With none connected, the form offers Connect Google.
- Choose the folder. Create a new inbox folder has Smole create the folder “SMOLE inbox – name” in that account's My Drive when you choose Enable. Use an existing folder lets you pick one folder in My Drive or in a shared drive; only the member who connected the Google account can pick a folder in it. The folder cannot be changed later: a different folder is a new source.
- Choose Create source. The source is created paused. Nothing is read until you choose Enable in the next step.
- The Enable step shows the address Smole reads the folder through. Choose Enable.
For an existing folder that already holds files, Smole cannot share the folder for you. The page then asks you to share the folder with that address as Viewer in Google Drive, and to choose Enable again. Google Drive offers Editor first, so change it to Viewer. If you can only view the folder, ask its owner to share it. If your organization blocks sharing outside it, a watched folder needs external sharing allowed for the folder's owner.
What Smole can read
- Smole will be able to read every file in this folder and in its subfolders. Google passes a folder's sharing down to everything inside it.
- It processes only the files directly in the folder, and reads nothing else in your Google Drive.
- Anyone who can add files to this folder can cause runs.
- Smole reads the folder through its own reader address, an account of Smole's own at Google (a service account) that the folder is shared with as Viewer. Through that address Smole only ever reads. Before every read it checks, with your own Google connection, that you can still open the folder.
- Smole stores the folder's ID, and the name, type, size and Google Drive file ID of every file directly in the folder, whether or not it is processed. A file that is processed is stored as the input of its run, like an uploaded document: the stored copy is scheduled for automatic deletion once it is 30 days old, with a seven-day recovery window in storage, and the results and the text read from the file stay in your account. The list is kept for as long as the source exists, and is deleted about 30 days after you delete the source.
What is processed
- Files of a supported type, up to 50 MB, that arrive in the folder after you choose Enable.
- Files already in the folder are listed under Received files and are not processed. Choose Process this file on a row to run one.
- A file that was created before you chose Enable and is moved into the folder in the first 15 minutes, or before Smole has checked the folder for the first time, is treated like a file that was already there: it is listed with Process this file and does not run by itself.
- A file is processed once. Renaming it or changing its content does not run it again.
- Not processed, and listed with the reason: Google Docs, Sheets and Slides files (download one as PDF in Google Drive, then add the PDF to the folder), shortcuts (add the file itself), empty files, unsupported types, files over 50 MB and files whose owner does not allow downloads. Files in subfolders are not processed.
- Files added while the source is paused, or has no linked workflow, wait in the folder and run afterwards.
- A workflow linked later receives only files that arrive after the link.
Cost
- Each file runs once in every linked workflow and is billed once for each.
- A source has no limit of its own: see What limits a source.
- Failed runs are not charged. Checking the folder is free.
When it needs attention
- Folder cannot be opened. The folder was deleted or moved to the bin, the Google account lost access to it, or it is no longer shared with Smole's reader address. Restore it, or share it again, in Google Drive, then choose Resume.
- Folder holds over 10,000 files. Move processed files out of the folder, then choose Resume.
- Google connection ended. Choose Connect <email> again; reading then resumes by itself.
- Google account disconnected. Connect the account again, then choose Resume.
- Paused: files keep failing. The last 20 files from this source all failed. Check the files or the workflow, then choose Resume.
Stopping and ending access
- Pause stops the reading until you choose Resume. Unlink stops it for one workflow.
- Delete source, on the connection's page, ends it. Smole stops reading the folder at once: it starts no new read. A file that Smole had already begun to fetch can still finish and run; files that are still waiting are not processed. The folder and its files stay in your Google Drive.
- One step stays with you: after deleting, remove Smole's reader address from the folder's sharing in Google Drive, unless another source still watches the same folder. The page shows the address again when you delete. Google does not let Smole end the share on a folder that holds your files. Until you remove the address, the folder is still shared with it, and Smole does not read it.
- Disconnecting the Google account on the Connections page, or removing Smole in your Google Account settings, also stops the reading: at once when you disconnect, within minutes when you remove it at Google. The reader address stays on the folder's sharing until you remove it there.
Email inbox
Smole gives this source its own address. Attachments mailed to this address run by themselves, in every linked workflow. Smole never reads the body of an email.
If your workflow page has an Integrations section and no Sources lane, your account does not have connected sources yet.
Setting it up
- On a workflow page choose Add source, then Email inbox. Or choose New source on the Connections page and link a workflow afterwards.
- Fill in Allowed senders, one per line: a full address, or a whole domain written as
@example.com. Mail from anyone else is listed, not processed. - Choose Create inbox. The inbox is created paused, and nothing runs until you link a workflow and choose Enable.
- You get the address when you choose Enable. Copy it, and send or forward documents to it, as attachments.
Forwarding mail automatically
- Add the mailbox that forwards to Allowed senders, for example
invoices@yourcompany.com. A forwarded mail passes when its original sender or the forwarding mailbox is on this list. So you list your own mailbox once, not every supplier. - Setting up forwarding in Gmail? Gmail mails a confirmation code to this address. Read the code in the subject of that mail under Received files; the mail is listed as not processed, because it has no attachment. Smole never reads the body of a mail, so a code that appears only in the body cannot be read here.
What is processed
- PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), image, HTML and text attachments, up to 50 MB each, from an allowed sender.
- At most 10 attachments of one email. Send a further one again in its own email.
- Not processed: images inside the email's body, such as a logo or a signature, archives, calendar invites, contact cards and unsupported types. A text or HTML file that arrives as an attachment runs as a document, also when the sending program attached the text of the mail that way.
- Mail sent to the address appears under Received files, with what happened to each attachment. Of mail that is not processed, the first 200 a day are listed. A mail from a sender who is not on the list offers Process anyway. A mail that arrived while no workflow was linked offers Retry once one is linked.
- Mail that arrives while the source is paused waits, and runs after you resume.
Cost
- Each attachment runs once in every linked workflow and counts as one document on your plan for each.
- A source has no limit of its own: see What limits a source.
- A source lists at most 10,000 attachment rows a day, one for each attachment and linked workflow. A mail that would pass that number is listed as one row, with Retry.
- Failed runs are not charged.
The allowed list is not proof of the sender
The allowed list keeps cost down. It is not proof of who sent a mail, because a sender address can be forged. Two things follow:
- Anyone who knows the inbox address and one allowed sender can cause runs until your plan's limit or your monthly budget stops the source. On Growth with no budget, nothing caps the cost.
- The fields extracted from a forged document are sent to the linked Google Sheet and webhook like any other. A system that acts on them, for example by paying an invoice, must not treat the inbox as proof of who sent it.
Keep the address private, and rotate it if it leaks.
What Smole stores
- The sender address, the subject and the attachments' names, types and sizes of each mail, and the supported attachments, which are stored like uploaded documents: the stored copy is scheduled for automatic deletion once it is 30 days old, with a seven-day recovery window in storage, and the results and the text read from the file stay in your account.
- Smole never fetches, stores or processes the body of the email.
- We fetch only the attachments from our email provider, Resend. Resend receives the whole message and keeps it under its own retention policy.
- The rows under Received files are kept for about 30 days after the mail was handled; a file that is still waiting is not deleted, and its 30 days start once it has been handled.
Stopping and undoing
- Pause makes mail wait until you choose Resume. Unlink stops the inbox for one workflow.
- Rotate address, on the connection's page, replaces the address. The current address stops working at once, and mail sent to it afterwards is not listed or processed (Resend still receives it). You get a new address to copy.
- Delete source, on the same page, ends it. The address stops working at once. Mail sent to it afterwards is not listed or processed (Resend still receives it), and files that are still waiting are not processed.
- If a mailbox forwards to the address, remove that forwarding rule in the mailbox as well.
Webhooks
A webhook sends a signed event to your HTTPS endpoint each time a run of a workflow finishes, so you do not have to poll. On a workflow page choose Add output, then Webhook (on a workflow page with an Integrations section, add it there). Then choose Send test to check your receiver. Smole shows the signing secret once, when you add the webhook or rotate its secret; store it in your receiver's configuration straight away.
Events
run.completed- A document finished extracting. The body carries the result unless you turned it off.run.failed- A document could not be processed.resultisnullanderrorsays why, with the failing fields when the result did not match the schema. Failed runs are not charged.ping- Sent by Send test. It never runs a document and is free.
{
"id": "0b6f4b1e-9c1d-4a5e-8f3a-2d7c6e5b4a39",
"type": "run.completed",
"createdAt": "2026-10-01T09:30:12.000Z",
"workspaceId": "…",
"data": {
"runId": "…",
"status": "completed",
"filename": "invoice.pdf",
"processingMode": "normal",
"workflowId": "…",
"workflowVersionId": "…",
"workflowVersion": 3,
"schemaId": "…",
"schemaVersion": 7,
"source": null,
"error": null,
"result": { "invoiceNumber": "INV-2024-001", "total": 1250.0 },
"resultTruncated": false
}
}The event id and the body bytes are the same on every attempt. A result over 256 KiB is left out: result is null, resultTruncated is true, and your receiver reads it with GET /api/pipeline/:runId and an API key.
source says how the document came in. It is null for a document sent with the API. For a document that came from a connected source it is an object with three fields: kind (google_drive_folder or email_inbox), bindingId (the source) and receiptId (the received file). It is the same on every attempt and on a redelivery.
A run.failed event has the same data fields, with status "failed", result null and an error object:
"error": {
"code": "RESULT_SCHEMA_INVALID",
"message": "Extraction failed: Final extraction does not match the submitted schema",
"stage": "extraction",
"retryable": false,
"errors": [
"$.total is required but the document does not state it",
"$.lines[0].qty must be number"
]
}code- The failure code, ornullwhen none was recorded.message- A short description, at most 500 characters, ornull.stage- Where the run failed, for exampleconversionorextraction, ornull.retryable- Whether submitting the document again can succeed, ornullwhen unknown.errors- ForRESULT_SCHEMA_INVALID, the failing field paths (at most 50). An empty array for every other code.
Headers and verification
Events follow Standard Webhooks, so any Standard Webhooks library can verify them.
webhook-id- The event ID, the same on every attempt.webhook-timestamp- The attempt time in Unix seconds.webhook-signature-v1,<base64>, an HMAC-SHA256 over<id>.<timestamp>.<raw body>. For 24 hours after you rotate the secret it holds two values, one per secret.smole-event-type-run.completed,run.failedorping.
// npm install standardwebhooks
import http from "node:http";
import { Webhook } from "standardwebhooks";
const webhook = new Webhook(process.env.WEBHOOK_SECRET); // whsec_...
const seen = new Set(); // use a durable store in production
http.createServer((request, response) => {
const chunks = [];
request.on("data", (chunk) => chunks.push(chunk));
request.on("end", () => {
let event;
try {
// Verify the raw body before parsing it. Refuses timestamps over 5 minutes old.
event = webhook.verify(Buffer.concat(chunks).toString("utf8"), request.headers);
} catch {
return response.writeHead(400).end();
}
if (!seen.has(event.id)) {
seen.add(event.id);
// handle event.type and event.data here
}
response.writeHead(204).end(); // answer 2xx for a repeat too
});
}).listen(8787);The complete receiver, with tests, is the examples/webhook-receiver project in the Smole repository.
Retries and redelivery
- Any 2xx answer delivers the event. Smole does not read the response body.
- 408, 425, 429, 5xx, a timeout (10 s) or a connection error is retried after about 1 min, 5 min, 15 min, 1 h, 4 h and 12 h, honouring
Retry-Afterup to 12 h. After 7 attempts the delivery fails. - 401 or 403 fails the delivery and marks the webhook as needing attention. 410 fails it and pauses the webhook. Redirects are never followed. Any other 4xx fails the delivery at once.
- After three failed deliveries in a row, Smole pauses the webhook. Events of later runs wait for up to 7 days until you resume it.
- Delivery is at least once and in no guaranteed order. Keep the
webhook-idvalues you processed and answer a repeat with 2xx. - The webhook's own page lists every delivery with its attempts. Filter by Failed to see the dead letters, and choose Redeliver to send one again with the same ID and body. Redelivery never processes the document again or charges for it.
Webhook URLs must be public HTTPS on port 443, without credentials in the URL. Smole checks the address on every attempt and refuses local and private networks. See API Reference to manage webhooks with an API key.
Google Sheets
A Google Sheet output adds a row to a spreadsheet each time a run of a linked workflow completes. Google accounts are connected on the Connections page, or under Account, Connections where the app bar has no Connections entry. Then, on a workflow page, choose Add output and Google Sheet; on a workflow page with an Integrations section, choose Add Google Sheet there. Smole creates a new spreadsheet in that account's Drive, called SMOLE – followed by the workflow's title or the output's name. It does not write to a spreadsheet you already have.
What Smole can access
- The only Google Drive permission Smole asks for is
drive.file. It covers files Smole creates, and files and folders you pick, and it also allows changing, deleting and sharing those files. Smole does not change or delete anything you picked. The only thing it shares is a watched folder, with its own reader address, which reads the folder. Smole does not read anything else in your Drive. - Smole reads the Google account's email address to label the connection.
- Disconnecting the account stops every write and every read and deletes Smole's stored access. The spreadsheets and folders stay in your Drive; a watched folder stays shared with Smole's reader address until you remove it in Google Drive. The account's email address stays in the workspace's integration history (the record of this workspace's connections and what they sent or received).
- Deleting the Google Sheet output in Smole does not delete its spreadsheet.
Layout
Documents- One row per completed run:$runId,$sourceFilename,$completedAt,$workflowVersion, then one column per field.- One tab per list field, named by its path (for example
line_items) - One row per item:$runId,$rowId,$parentRowId,$index, then the item's fields. This is the same layout as the XLSX export. - Values are written as they were extracted: text is never turned into a formula or a date, and numbers stay numbers. Text over 50,000 characters is cut and ends in
…[truncated]. - When a later run has a new field, its column is added on the right. Existing columns are never moved or renamed.
- Only completed runs are written. Failed runs are never written and are not charged.
- When a Google Sheet is linked to several workflows, each further workflow writes to its own tabs, named with the workflow's title in front.
Do not restructure the Smole tabs
Keep row 1 and column A of every Smole tab as they are: column A holds $runId, which Smole reads before each write so that a run is never written twice. Adding your own columns to the right, moving other columns and adding your own tabs are safe. A Smole tab you delete is created again with its header on the next run.
- If cell
A1of a Smole tab is no longer$runId, Smole stops and marks the output as Needs attention rather than write over your data. Put$runIdback inA1of every Smole tab, then choose Resume. - If the spreadsheet is deleted or reaches Google's size limit, the output also needs attention. Restore the spreadsheet or free up space, then resume, or add a new Google Sheet.
- If Google no longer accepts the connection, the output's own page offers Connect <email> again: choose it and pick that Google account, and writing resumes by itself. Runs that finished in the meantime are written then (they wait up to 7 days). A delivery that already failed stays failed until you choose Redeliver on it. If the account was disconnected in Smole, or the output was paused, connect it again and then choose Resume.
Testing and redelivery
- Send test checks that Smole can open the spreadsheet and that the tab layout is intact. It writes nothing.
- Runs are written one at a time, a few seconds apart, so a large batch takes a while to appear.
- Redeliver never adds a second row for a run that is already in the spreadsheet, and never processes the document again or charges for it.
Batch Processing
Process multiple documents by submitting them in parallel and polling for results:
# Submit multiple documents
for file in invoices/*.pdf; do
curl -s -X POST https://api.smole.tech/api/pipeline/file \
-H "X-API-Key: smole_your_api_key" \
-F "file=@$file" \
-F "schemaId=your_schema_id" >> job_ids.txt
echo "" >> job_ids.txt
done
# Poll each job for completion
# (use jq to extract the job ID from each response)