I want to add participant data to the conversation from my workflow using the /api/v2/conversations/{conversationId}/participants/{participantId}/attributes API, but can't figure out how to retrieve ID of conversation the workflow belongs to (I can't pass ID as input parameter to the workflow).
Unfortunately, I can't pass conversation ID as the input parameter to my workflow, because I am going to execute it from the Data Action action of the wrap-up call rule for outbound calls that were not answered by person.
And there is no parameter in the wrap-up call rule (at least, I have not found) that contains current conversation ID .
There isn't currently any way to get the conversation ID in this context. You can request new features and share your use case at https://genesyscloud.ideas.aha.io/.
Depending on what you're trying to do, you should be able to make a strongly educated guess about the conversation ID by:
Use an analytics conversation detail query with a filter on the contact ID and the interval set to +/- a reasonable time from the last attempt timestamp to find the conversation
It's also worth pointing out that this sort of automation is exactly the sort of use case encompassed by Triggers, which are currently in beta (the APIs for managing Triggers can be found in the PreviewAPI section of the developer center, grouped under "process automation"). A trigger allows for the subscription to an event topic, applies filtering logic to the event message, and in the event of a match with the filter criteria, will execute a workflow. These workflows do accept "ID" as an input, which is taken directly from the event payload.