The JSON structured representations for the different types of units supported on our platform are contained in the expandable sections presented throughout the present page, accompanied each time by a corresponding example.
For a description of unit input templating, the reader is referred to this section of the documentation.
{"$id":"workflow/unit","$schema":"http://json-schema.org/draft-07/schema#","title":"workflow unit schema","type":"object","oneOf":[{"$ref":"./unit/io.json"},{"$ref":"./unit/reduce.json"},{"$ref":"./unit/condition.json"},{"$ref":"./unit/assertion.json"},{"$ref":"./unit/execution.json"},{"$ref":"./unit/assignment.json"},{"$ref":"./unit/processing.json"},{"$ref":"./unit/map.json"},{"$ref":"./unit/subworkflow.json"}],"discriminator":{"propertyName":"type"},"required":["type"]}
{"$id":"workflow/unit/execution","$schema":"http://json-schema.org/draft-07/schema#","title":"execution unit schema (base)","type":"object","allOf":[{"$ref":"./base.json"},{"$ref":"runtime/runtime_items.json"}],"properties":{"type":{"enum":["execution"]},"application":{"description":"Contains information about the simulation engine/application.","$ref":"../../software/application.json"},"executable":{"description":"Contains information about the simulation engine/application executable.","$ref":"../../software/executable.json"},"flavor":{"description":"Contains information about the simulation engine/application flavor.","$ref":"../../software/flavor.json"},"input":{"description":"unit input (type to be specified by the application's execution unit)"}},"required":["input","application"]}
{"$id":"workflow/unit/processing","$schema":"http://json-schema.org/draft-07/schema#","title":"processing unit schema","type":"object","allOf":[{"$ref":"./base.json"}],"properties":{"type":{"enum":["processing"]},"operation":{"description":"Contains information about the operation used.","type":"string"},"operationType":{"description":"Contains information about the specific type of the operation used.","type":"string"},"inputData":{"description":"unit input (type to be specified by the child units)"}},"required":["operation","operationType","inputData"]}
{"$id":"workflow/unit/io","$schema":"http://json-schema.org/draft-07/schema#","title":"data IO unit schema","type":"object","allOf":[{"$ref":"./base.json"}],"properties":{"type":{"enum":["io"]},"subtype":{"enum":["input","output","dataFrame"]},"source":{"enum":["api","db","object_storage"]},"input":{"type":"array","items":{"anyOf":[{"$ref":"io/api.json"},{"$ref":"io/db.json"},{"$ref":"io/object_storage.json"}]}}},"required":["subtype","source","input"]}
{"$id":"workflow/unit/io/api","$schema":"http://json-schema.org/draft-07/schema#","title":"data IO rest API input schema","type":"object","properties":{"endpoint":{"description":"rest API endpoint","type":"string"},"endpoint_options":{"description":"rest API endpoint options","type":"object"},"name":{"description":"the name of the variable in local scope to save the data under","type":"string"}},"required":["endpoint","endpoint_options"],"additionalProperties":true}
{"$id":"workflow/unit/io/db","$schema":"http://json-schema.org/draft-07/schema#","title":"data IO database input/output schema","type":"object","oneOf":[{"properties":{"ids":{"description":"IDs of item to retrieve from db","type":"array","items":{"type":"string"}}},"required":["ids"],"additionalProperties":true},{"properties":{"collection":{"description":"db collection name","type":"string"},"draft":{"description":"whether the result should be saved as draft","type":"boolean","default":true}},"required":["collection","draft"],"additionalProperties":true}]}
{"$id":"workflow/unit/io/object-storage","$schema":"http://json-schema.org/draft-07/schema#","title":"object_storage io schema","type":"object","allOf":[{"$ref":"../../../core/reusable/file_metadata.json"}],"properties":{"objectData":{"$ref":"../../../core/reusable/object_storage_container_data.json"},"overwrite":{"description":"if a file with the same filename already exists, whether to overwrite the old file","type":"boolean","default":false}},"required":["objectData"],"additionalProperties":true}
{"$id":"workflow/unit/assignment","$schema":"http://json-schema.org/draft-07/schema#","title":"assignment unit schema","type":"object","allOf":[{"$ref":"./base.json"},{"$ref":"./../../system/scope.json"}],"properties":{"type":{"enum":["assignment"]},"input":{"description":"Input information for assignment. if omitted, means that it is an initialization unit, otherwise it is an assignment.","type":"array","items":{"$ref":"input/_inputItemScope.json"}},"operand":{"description":"Name of the global variable. e.g. 'x'","type":"string"},"value":{"description":"Value of the variable. The value content could be a simple integer, string or a python expression. e.g. '0' (initialization), 'sin(x)+1' (expression)","oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]}},"required":["name","operand","value"]}
{"$id":"workflow/unit/condition","$schema":"http://json-schema.org/draft-07/schema#","title":"condition unit schema","type":"object","allOf":[{"$ref":"./base.json"}],"properties":{"type":{"enum":["condition"]},"input":{"description":"Input information for condition.","type":"array","items":{"$ref":"input/_inputItemScope.json"}},"statement":{"description":"Condition statement. e.g. 'abs(x-total_energy) < 1e-5'","type":"string"},"then":{"description":"Flowchart ID reference for `then` part of the condition.","type":"string"},"else":{"description":"Flowchart ID reference for `else` part of the condition.","type":"string"},"maxOccurrences":{"description":"Maximum occurrence of the condition, usable for loops.","type":"integer"},"throwException":{"description":"Throw exception on reaching to maximum occurence.","type":"boolean"}},"required":["input","statement","then","else","maxOccurrences"]}
{"$id":"workflow/unit/map","$schema":"http://json-schema.org/draft-07/schema#","title":"map unit schema","type":"object","allOf":[{"$ref":"./base.json"}],"properties":{"type":{"enum":["map"]},"workflowId":{"description":"Id of workflow to run inside map","type":"string"},"input":{"description":"Input information for map.","type":"object","properties":{"target":{"description":"Name of the target variable to substitute using the values below. e.g. K_POINTS","type":"string"},"scope":{"description":"Scope to retrieve `values` from, global or flowchartId. Optional if `values` is given.","type":"string"},"name":{"description":"Name of the variable inside the scope to retrieve `values` from. Optional if `values` is given.","type":"string"},"values":{"description":"Sequence of values for the target Jinja variable. Optional if `scope` and `name` are given. This can be used for map-reduce type parallel execution","type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object"}]}},"useValues":{"type":"boolean"}},"required":["target"]}},"required":["input","workflowId"]}
{"$id":"workflow/unit/reduce","$schema":"http://json-schema.org/draft-07/schema#","title":"reduce unit schema","type":"object","allOf":[{"$ref":"./base.json"}],"properties":{"type":{"enum":["reduce"]},"mapFlowchartId":{"description":"corresponding map unit flowchart ID","type":"string"},"input":{"description":"input information for reduce unit","type":"array","items":{"type":"object","properties":{"operation":{"description":"reduce operation, e.g. aggregate","type":"string"},"arguments":{"description":"arguments which are passed to reduce operation function","type":"array","items":{"type":"string"}}},"required":["operation","arguments"]}}},"required":["mapFlowchartId","input"]}