WorkersGenerators
Text
📸 Screenshots
Here are visual examples of this section:
Text - Worker Configuration Interface
1. Overview and Purpose
The Text worker generates static content of various types including text strings, numbers, booleans, media files (audio, images, files), and timestamps. It serves as a foundational content generator that outputs predefined values based on the selected content type. This worker is essential for providing static data inputs to other workers in your AI workflow.
2. Configuration Parameters
The Worker accepts the following parameters:
text: The text string to output when contentType is "text"contentType: Specifies the type of content to generate - can be "text", "number", "audio", "image", "file", "Timestamp", or "boolean"contentUri: The URI/path to output when contentType is "audio", "image", or "file"numberValue: The numeric value to output when contentType is "number"booleanValue: The boolean value to output when contentType is "boolean"
3. Input/Output Handles
output: Output handle - returns the generated content based on the selected contentType and corresponding parameter value
4. Usage Examples with Code
// Example: Generate static text content
const textWorker = {
parameters: {
contentType: "text",
text: "Hello, World!"
}
}
// Example: Generate a number
const numberWorker = {
parameters: {
contentType: "number",
numberValue: 42
}
}
// Example: Generate a file reference
const fileWorker = {
parameters: {
contentType: "file",
contentUri: "/path/to/document.pdf"
}
}5. Integration Examples
The Text worker is commonly used as a starting point in workflows to provide static inputs to other workers, or to supply default values and configuration data that other processing workers require.
6. Best Practices
- Choose the appropriate contentType to ensure proper data typing for downstream workers
- Use meaningful text values that clearly indicate their purpose in the workflow
- For media files, ensure contentUri paths are accessible and valid
- Consider using the Timestamp contentType when you need current date/time markers
7. Troubleshooting Tips
- If output is empty, verify that the parameter corresponding to your contentType is properly set
- For media content types, ensure the contentUri is a valid path or URL
- Number outputs default to 0 if numberValue is undefined
- Boolean outputs default to false if booleanValue is undefined
