Know what you have
Changing a filename does not convert bytes, and serializing an object does not
create a File. Use an explicit conversion action so the boundary is visible on
the canvas.
Create and download files
Use Create Text File when the content already exists as a String. Supply the complete filename, including an extension. To deliver structured data as a file, convert the value to JSON, createreport.json from that text, then upload, attach, or return the
resulting File.
The filename extension is used to infer the MIME type when recognized.
Use Download File from URL to
retrieve a public resource. You can provide a filename or let the action derive
one from the URL path. It uses the response’s content type when available and
fails for non-success responses.
Rename without converting
Rename File returns a copy with a new name while preserving its bytes and MIME type. Renaminginvoice.png to invoice.jpg still leaves PNG image data inside the
file and preserves the original MIME type. Use a format-specific conversion
action when the content itself must change.
Convert files to and from data URLs
Convert File to Data URL creates a String in this form:data:MIME_TYPE;base64,DATA form. The output is named
converted.EXTENSION, with the extension derived from the MIME type.
A normal
https:// URL is not a data URL. Download it with Download File
from URL instead.Parse JSON text
Parse JSON converts a valid JSON String into its native value: an Object, List, String, Number, Boolean, ornull.
Serialize values as JSON or YAML
Convert to JSON serializes a workflow value as JSON text. Enable pretty formatting for human-readable output; compact output is usually better for API requests or storage. Convert to YAML emits YAML using two-space indentation. Its Use references? option represents repeated objects with YAML anchors and aliases. Leave references off when every section should be standalone and easy to copy. Serialization is useful at an external boundary: For example, build an Object, convert it to JSON, then createpayload.json
from the serialized text.
Validate structured data
Validate JSON Schema checks any value against a JSON Schema and returns:- Is Valid, a Boolean;
- Errors, a list containing every validation error found; and
- the original validated value or top-level property outputs, depending on the schema.
properties. Connect Is Valid to
Route Value or a Conditional meta
control before using those values. One safe pattern is:
- Parse the JSON text.
- Validate the parsed value against the schema.
- Connect both the validated object and Is Valid to Route Value.
- Continue processing from If True.
- Use If False to record the validator’s Errors.
"18" does not satisfy an
integer schema. It also does not strip extra properties, and property outputs
remain the supplied values even when validation fails.
Choose the right conversion
I have an object and an API expects JSON text
I have an object and an API expects JSON text
Use Convert to JSON. If the API action accepts a structured body
directly, connect the Object instead.
I have JSON text and need individual fields
I have JSON text and need individual fields
Use Parse JSON, then select properties from the resulting value.
I have text that must become an attachment
I have text that must become an attachment
Use Create Text File and give it the correct filename extension.
I have a public URL and need a File
I have a public URL and need a File
Use Download File from URL.
I have a File but the destination expects embedded data
I have a File but the destination expects embedded data
Use Convert File to Data URL.