Error - Invalid Interactivity Pointer when launching a custom function via a workflow URL
Hi team. I'm working on a custom function with Bolt and having issues opening a modal.
To open a modal, we either need a trigger ID or an interactivity pointer. With a function (started via a workflow link), we get an interactivity pointer via the payload (via inputs, as defined in the function with interactivity). There is no trigger ID in the payload (that I can see).
When attempting to open the modal using the interactivity pointer in the payload, I am getting an error of invalid interactivity pointer.
if this is not the correct pointer, then where do we get the correct one?
Thank in advance...
Payload from inputs when running the function from the link...
{
interactivity: {
interactor: {
secret: 'ABCDEFGwMDgwMi4xMDMxMzI5MTA5NTg0LjFiNGMyMGMwM2E2NWFlMWYyYmQ4YzNjMTczMTllOTk3',
id: 'U01HABCDEFG'
},
interactivity_pointer: '7906065500802.1031329109584.1b4c20c03a65ae1f2bd8c3c17319e997'
},
'interactivity.interactor.secret': 'ABCDEFGwMDgwMi4xMDMxMzI5MTA5NTg0LjFiNGMyMGMwM2E2NWFlMWYyYmQ4YzNjMTczMTllOTk3',
'interactivity.interactor.id': 'U01HABCDEFG',
'interactivity.interactor': {
secret: 'NzkwNjA2NTUwMDgwMi4xMDMxMzI5MTA5NTg0LjFiNGMyMGMwM2E2NWFlMWYyYmQ4YzNjMTczMTllOTk3',
id: 'U01HABCDEFG'
},
'interactivity.interactivity_pointer': '7906065500802.1031329109584.1b4c20c03a65ae1f2bd8c3c17319e997',
usercontext: {
secret: 'ABCDEFGwMDgwMi4xMDMxMzI5MTA5NTg0LjFiNGMyMGMwM2E2NWFlMWYyYmQ4YzNjMTczMTllOTk3',
id: 'U01HABCDEFG'
}
}
Call to open the modal...
const startwindow = await client.views.open({
interactivity_pointer: inputs.interactivity.interactivity_pointer,
view: await buildStartingWindow(pvt_metadata_startingwindow, "initial_modal"),
});
Error
[ERROR] An unhandled error occurred while Bolt processed (type: event_callback, error: Error: An API error occurred: invalid_interactivity_pointer)
Hi @mcsescott, thanks for trying out the custom step!
You're correct in noting that you can use the interactivity_pointer in the same way as the trigger_id in the code.
Based on the information provided, we're not yet sure what might be causing your situation. However, if you could share a minimal working example that reproduces your issue, we may be able to help you better. Also, if you haven't checked it out yet, here is our project template for custom steps: https://github.com/slack-samples/bolt-js-custom-step-template. Merging your code into this template and seeing how it goes may be helpful.
Hope you'll figure the caues out soon!
Thanks @seratch.
I am very familiar with custom workflow steps, having built 20+ of them with the NextGen platform, and then another 15-20 with steps from apps.
The example you provided doesn’t account for the trigger. Yes, it has a user id as an input, but that also requires configuration of the step. It doesn’t have the “interactivity” input to get the interactivity pointer. In addition, the sample/template is sending a message, not opening a modal (which is where the problem lies).
I’ll work up a sample function that I can post here that more clearly demonstrates the code.
Hi @mcsescott !
I think this is a known issue that we have resolved but are slow-rolling it out - a fix should be generally available soon.
The underlying problem is this: a custom function hosted 'remotely' (i.e. not in a deno-slack-sdk app) only exposes functions to other workflows. These other workflows are technically a separate app, that is, the workflow containing your custom function step is housed within a different app than the the app within which the custom function "belongs" to (workflows built in WFB, while not associated with an app per se, get an app created transparently for each workflow in the background). Today, the interactivity pointer / trigger ID will error in this way because the security constraints / checks on interactivity pointers do not allow for this 'cross-app' interactivity usage.
As I mentioned, this should be resolved in the near future - we have a fix already rolled out, but behind a feature flag to monitor this change. I will follow up on the state of the full production rollout today and report back once I have more information on a timeline.
That makes a little bit of sense, thanks @filmaj. You know I'm always trying to push the limits of workflow steps...
If you are building such workflows for a particular workspace (e.g. your company's), we may be able to get that workspace enabled for this feature early / in a beta fashion (assuming that interests you). Once the west coast of North America gets up I can double-check this (as well as the more general public rollout). Are you on the Slack Community workspace? community.slack.com. If you are, you can find me there (same name) and DM me your workspace details and I can look into that today.
Update:
This issue with the interactivity_pointer has been resolved with the feature flag that @filmaj spoke about. It works as designed now, even though I can't really complete the workflow.
Thanks for the support!
Will close this issue down, then!