Working with File-Based Workflow Triggers
WorqHat workflows can process various types of files, from documents and images to data files and media. This guide explains how to trigger workflows using file uploads or by providing URLs to files, enabling powerful document processing, media analysis, and data extraction capabilities.Understanding File-Based Workflow Triggers
File-based triggers allow you to send files to your workflows for processing. WorqHat supports two primary methods:- Direct File Upload: Upload a file directly from your application or system
- URL-Based Processing: Provide a URL to a publicly accessible file that WorqHat will download and process
When to Use File-Based Triggers
File-based workflow triggers are ideal for scenarios like:- Document processing and analysis
- Image recognition and processing
- Data extraction from structured files (CSV, Excel, etc.)
- Media transcription and analysis
- Report generation from uploaded data
- Processing user-submitted files in your applications
Prerequisites
Before triggering a workflow with files, you’ll need:- A WorqHat account with workflow creation permissions
- An API key with appropriate permissions
- The workflow ID of the workflow you want to trigger
- Files to process or URLs pointing to files
Quickstart: Trigger with File or URL
The SDKs accept a single payload object/dict as the second argument that contains eitherfile
or url
plus any additional inputs your workflow expects.
Sending Files to a Workflow
API Endpoint
multipart/form-data
with either a file upload or a URL to a file.
Method 1: Direct File Upload
WorqHat provides multiple ways to upload files directly to your workflows, making it easy to integrate with different environments and file sources.Method 2: URL-Based Processing
When the file is available at a URL (such as in cloud storage or a public web location), you can simply provide the URL:Direct API Access with cURL
If you need to trigger workflows with files directly from the command line or in shell scripts, you can use cURL:Option 1: File Upload with cURL
Option 2: URL Input with cURL
Working with Responses
When you trigger a workflow with a file or URL, you’ll receive an immediate response. Processing happens asynchronously. A typical response includes:Request Body Format
The API acceptsmultipart/form-data
with the following fields:
Field | Type | Description |
---|---|---|
file | File | The file to upload (required if not using URL) |
url | String | URL to a file to be downloaded and processed (required if not uploading a file) |
[custom parameters] | String/Number/Boolean | Any additional parameters needed by your workflow |
Combining File Uploads with Additional Parameters
For complex workflows, you can include both file uploads (or URLs) and additional parameters in the same request:Best Practices
File Size and Type Considerations
- File Size Limits: WorqHat supports files up to 50MB. For larger files, consider breaking them into smaller chunks or using cloud storage with URL-based processing.
- Supported File Types: Any file type is supported, including:
- Documents: PDF, DOCX, TXT, RTF
- Images: JPG, PNG, GIF, TIFF, WebP
- Data: CSV, JSON, XML, XLSX
- Media: MP3, MP4, WAV
- And many more
URL Processing Details
When using URL input instead of direct file upload:- The server will download the file with a 60-second timeout
- The filename will be extracted from the Content-Disposition header or URL path
- The downloaded file will be processed as if it were directly uploaded
- Request timeout is set to 5 minutes to allow for large file processing
- Only one file or URL can be processed per request
- All form fields are forwarded to the backend service
Multiple Ways to Provide Files
WorqHat’s SDK supports various file input formats, giving you flexibility in how you handle files:Security Best Practices
- Always validate files before uploading them to workflows
- Use HTTPS for all API communications
- For sensitive documents, consider implementing additional encryption
- When using URL-based processing, ensure the URLs are properly secured and temporary if needed