Work with external systems in Orchestra
A process in Orchestra can do something in an external system, such as looking up a person in the CRM, updating a record, calling an API or fetching a document. First set up the connection itself in Hub. For more information, see Connect a system in Hub. The sections below explain how a process uses that connection, and what happens when the external system doesn't respond as expected.
Choose the right block
The block you use depends on what Odigos already knows about the system. There are four situations:
- Odigos provides a data structure for the system. Use the standard data blocks.
- The documents are in SharePoint. Create a structure for the connection in Hub.
- Odigos doesn't know the system as a data structure. Call the API yourself, with a connection from Hub.
- You want to deliver a file to a partner. Use an SFTP connection.
Use the data structure of the system
Odigos provides ready-made data structures for a number of systems, such as the people and organisations in Pipedrive, the objects and relations in RealWorks and the people in Apollo. The external system is then the storage: the records live there, not in Odigos. You don't create these data structures yourself. You work with them using the same blocks as for your own data:
- Read from datalake reads records from the system.
- Store data in datalake creates or updates a record.
- Delete from datalake deletes a record.
Odigos maps the fields of the external system to the fields of the data structure, and back. The rules on the data structure also apply when you write to the external system. The records also appear in Dossier.
Not every system allows everything. Apollo, for example, is read-only, so a step that writes to that data structure is refused.
For some data structures, the store step first checks whether the record already exists. If it does, the step updates it instead of creating a second one. This prevents duplicate people or organisations in the CRM.
Documents in SharePoint
For a SharePoint library you create the structure yourself. In Hub, open the connection and click Create a structure. Choose the folder and what a process is allowed to do there. You then use that structure in your process:
- Read from datalake reads the documents and folders in a folder.
- Fetch external file copies one document to the Odigos files. The process only receives a reference to the file, not its content.
- Store data in datalake and Delete from datalake place, rename or move a document, or move it to the recycle bin.
Writing only works if the structure and the permissions of the connection allow it. If a step asks for more, Odigos refuses to save the process and tells you what is missing.
Call an API yourself
If Odigos has no data structure for the system, call the API with the REST API task block. Under Connection (authentication), choose the connection from Hub. The connection then supplies the credentials and the base URL. If the address in the step starts with a /, Odigos adds it to the base URL of the connection.
If a connection has several keys, each key appears as a separate option in the list. If the connection isn't in the list yet, create it in Hub with New connection in Hub and then click Refresh list. Leave the field empty for an open API that needs no credentials.
For the other settings of the step, see REST API task.
No secrets in the step itself
Never put a token, key or password in the URL, the headers or the body of a step. The secret would then be stored in the process, and Hub can't see that the process depends on the system. Always choose the connection.
Files for a partner and AI steps
With Deliver file to partner, a process places a file on the SFTP server of a partner in your chain. The connection supplies the server and the credentials. In the step, you enter the folder, the file name and the content. The file isn't added to the Odigos files. If the delivery fails, the error message names the connection and the path.
To use your own subscription with an AI provider for the AI step and the agent block, connect it in Hub under AI providers. You choose the provider for a step on the block itself. For more information, see Delphi AI task.
When the external system fails
A step that calls an external system can fail. The system may be unreachable, reject the login or return an unexpected response. The process then stops:
- The process instance stays on the failed step and pauses.
- The person responsible for the process receives an email with the error message and links to Murphy and StatusQuo.
- Once the cause is fixed, choose Restart task in StatusQuo. The step runs again and the process continues.
Sometimes a system does respond, but the response means you should try again later. In that case, set Retry on error condition on the step, with a condition, a number of attempts and a waiting time. If the last attempt still fails, the process instance pauses as described above.
For more information about alerts, see Investigate an error in Murphy.
Error handling on a step
With Error handling on a step, you send an error down a different path in the process. Only use this when the error really means a different outcome. For example, the record no longer exists at the supplier, and the customer needs to receive a different message.
Don't catch a failure that resolves itself. If the error path leads to an end event, the process instance is finished, while after a restart it could have continued as normal. A caught error also doesn't create an alert in Murphy or send an email to the person responsible for the process.
Acceptance and production
The secret of a connection is stored per environment. What you enter on acceptance doesn't apply on production. A connection without a secret on the environment you're working on shows as Dormant in Hub. In the list of a step, the connection is then followed by "dormant on this stage".
Before a process goes to production, open Hub on production and check that the connection is Active there. If it's Dormant, enter the secret first.
Change a connection while processes are running
A step only fetches the connection when it runs. A change to the connection therefore applies immediately, including to process instances that are already running. For each connection, Hub shows which processes use it, with the version and the number of running process instances. Check this before you change anything.
- Change a key, group or installation value. This immediately changes what the processes send out. If a process uses the connection, Hub asks you to confirm first.
- Revoke. Steps that use the connection get stuck and the process instance pauses. When you make the connection active again, restart the stuck steps in StatusQuo.
- Delete. You can only delete a connection when no process or data structure uses it. Until then, Odigos refuses.
See also
- Connect a system in Hub: set up a connection in Hub
- REST API task: set up an API step
- Investigate an error in Murphy: alerts from a failed step
- Delphi AI task: an AI step with your own provider