Serialize
Serializes JSON data into Avro binary format and saves it to a file.
Task version: 2.0.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
Source code: https://github.com/FrendsPlatform/Frends.Avro
Task Parameters
Json : String
Input JSON string that can be both single objects and arrays of objects.
The JSON data will be serialized according to the provided Avro schema.
Default: -
Example: Single object: { "name": "Jerry", "age": 30, "city": "New York" } Array of objects: [{ "name": "John", "age": 30 }, { "name": "Jane", "age": 25 }]
Schema : String
Avro Schema definition in JSON format that defines the structure of the data to be serialized.
Must be a valid Avro schema that matches the structure of the input JSON data.
Default: -
Example: { "type": "record", "name": "Person", "fields": [ { "name": "name", "type": "string" }, { "name": "age", "type": "int" }, { "name": "city", "type": "string" } ] }
TargetFilePath : String
Full path to the target file where the serialized Avro data will be stored.
The directory must exist and the file must not already exist (unless overwrite is enabled).
Default: -
Example: Windows: C:\data\output\myfile.avro Linux/Mac: /home/user/data/myfile.avro
ThrowErrorOnFailure : Boolean
Determines error handling behavior. If true, throws an exception when serialization fails.
If false, returns error information in the Result object instead of throwing.
Default: True
Example: true
ErrorMessageOnFailure : String
Custom error message to use when ThrowErrorOnFailure is false and an error occurs.
If null or empty, the original exception message will be used.
This allows for user-friendly error messages in automated workflows.
Default: -
Example: Failed to serialize data to Avro format
Task Result
Success : Boolean
Indicates whether the serialization operation completed successfully. True if the JSON data was successfully serialized to Avro format, false if an error occurred.
Example: true
FilePath : String
Full path to the created Avro file when serialization is successful. Empty string when serialization fails.
Example: C:\results\myfile.avro
Error : Error
Error information when the serialization task fails and ThrowErrorOnFailure option is set to false. Contains detailed error message and additional debugging information. Null when the operation succeeds or when ThrowErrorOnFailure is true.
Task Changelog
Changelog for Task Frends.Avro.Serialize.
[2.0.0] - 2025-08-07
Changed
[Breaking] Renamed
OutputPathparameter toTargetFilePathin Input tabUpdated Result structure to include Success boolean and Error object
Added
Added new Options tab with error handling parameters (ThrowErrorOnFailure, ErrorMessageOnFailure)
[1.0.0] - 2024-05-23
Added
Initial implementation
Last updated
Was this helpful?

