Exactly.
I’m not sure what you mean by ‘getting data in and sending data out’.
By definition, external actions are solely used for sending data from Fibery to a custom app. The app should return a success or failure message, but otherwise data only goes one way.
Here’s an example of how a very basic app domain schema might look:
{
"id": "ext-app",
"name": "Ext",
"version": "1.0.0",
"description": "External actions",
"authentication": [
{
"id": "public",
"name": "Public Access",
"description": "There is no any authentication required",
"fields": []
}
],
"sources": [],
"responsibleFor": {
"dataSynchronization": true,
"automations": true
},
"actions": [
{
"action": "create-record",
"name": "Create record",
"args": [
{
"id":"publicId",
"name":"Public ID",
"type":"text",
"description":"The entity's public ID"
},
{
"id":"user",
"name":"Who triggered the automation",
"type":"text",
"description":"The public ID of the user who triggered this"
}
]
}
]
}
and then it’s up to you to figure out what should happen inside the app when the data is received, e.g.
app.post(`/api/v1/automations/action/execute`, wrap(async (req, res) => {
let {action} = req.body;
if (action.action == "create-record") {
//do stuff
return res.json({"message":"Success"});
}
else {
return res.json({"message":"Invalid action"});
}
}));
If you want to check out a reasonably complex example, there is a user-created custom app on Github: GitHub - reify-academy/fibery-toggl-integration: Integration between fibery and toggl