WorkItem Combine API Reference
The endpoint workitems/combine allows users to create a simple fan-in workflow where 1-N workitems (parts
) must complete before the final workitem (combinator
) is processed.
Request Payload:
{
"parts" : [
// an array of WorkItem payloads
],
"combinator": {
// a WorkItem payload for an activity with variable arguments
}
}
Show More
- parts: The WorkItem payload should have at least one output argument with das://intermediate/<filename> URL.
- combinator: A WorkItem payload for an activity with variable arguments (vararg). The variable arguments don’t need to be supplied explicitly becaues the outputs of the parts will be wired here. Other, non-variable, arguments can be supplied explicitly as usual.
Example
The following example message is a post-workitem-combine request that combines the PDF output from 2 DWG files into a single PDF.
{
"parts": [
{
"activityId" : "AutoCAD.PlotToPdf+prod",
"arguments" {
"HostDwg": {
"url": "http://sample.com/drawing1.dwg",
},
"Result" : {
"url": "das://intermediate/page1.pdf" //specifies an intermediate file called "page1.pdf"
}
}
},
{
"activityId" : "AutoCAD.PlotToPdf+prod",
"arguments" {
"HostDwg": {
"url": "http://sample.com/drawing2.dwg",
},
"Result" : {
"url": "das://intermediate/page2.pdf" //specifies an intermediate file called "page2.pdf"
}
}
}
],
"combinator":{
"activityId" : "AutoCAD.CombinePdf+prod",
"arguments" {
"Parameters": { // non-variable input argument that is supplied explicitly
"url" : "http://sample.com/some.json"
},
"Result" : {
"url": "http://sample.com/final.pdf",
"verb": "put"
}
}
}
}
Show More
What happens when the above request is processed:
- Each das://intermediate URL is replaced with an s3 presigned URL (writeable) in Das Intermediate Storage
- Arguments in
combinator
is populated with all the outputs of theparts
(readable presigned URLs) in Das Intermediate Storage combinator
is queued, but waiting forparts
.parts
are queued for processing.- When all
parts
are complete. Thecombinator
workitem is processed.