Skip to content

Instantly share code, notes, and snippets.

@zubairov
Last active February 26, 2018 08:47
Show Gist options
  • Save zubairov/6360ff44e98d8792e5071750ba2ab6cb to your computer and use it in GitHub Desktop.
Save zubairov/6360ff44e98d8792e5071750ba2ab6cb to your computer and use it in GitHub Desktop.
{
"data": {
"type": "flow",
"attributes": {
"name": "Synchronous API Sample",
"description": null,
"graph": {
"nodes": [
{
"id": "step_1",
"command": "elasticio/webhook:receive@latest",
"name": "Receive HTTP Request",
"description": "This component will receive an HTTP Request, if you want to see how it works just add `name` parameter. Usually WebHook works in asynchronous mode however if `HTTP Reply` component is found in the flow it will delay response until the processing will reach the first `HTTP Reply` component.",
"fields": {
"payload": "{}"
},
"selected_data_samples": [
"webhook"
],
"out_data_samples": [
"webhook"
]
},
{
"id": "step_2",
"command": "elasticio/request-reply:reply@latest",
"name": "Reply with message",
"description": "This component will form a JSON reply and send it back to requester",
"service": "request-reply",
"selected_data_samples": [],
"out_data_samples": []
}
],
"edges": [
{
"id": "mapper:step_1:step_2",
"config": {
"mapper_type": "jsonata",
"condition": null,
"mapper": {
"responseBody": "{\n\t\"message\": \"Hello \" & ($exists(name)?name:'world') & '!'\n}",
"contentType": "\"application/json\""
}
},
"source": "step_1",
"target": "step_2"
}
]
},
"created_at": "2018-02-23T13:13:21.925Z"
}
}
}
{
"webhook": {
"data": {
"type": "data-sample",
"attributes": {
"result": {
"body": {
"name": "World"
}
},
"method": "receive"
},
"relationships": {
"component": {
"data": {
"id": "55ba18e35d04040500000004",
"type": "component"
}
},
"component_version": {
"data": {
"id": "17820a594bd92a46d2a20b95925b5b0ce35596d1",
"type": "version"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment