https://linen.dev logo
Trigger API discrepancies
# 🖥│support-forum
u
There seem to be some sort of discrepancies in the API and the SDK. I tested both. For instance:
const triggerEnums = await composio.triggers.listEnum()
returns 1600+ enums with duplicates. The same goes for it's API equivalent:
https://backend.composio.dev/api/v3/triggers_types/list/enum
. I found only 140+ are unique items. Example
OUTLOOK_EVENT_CHANGE_TRIGGER
appeared like 23 times. However, the list types:
Copy code
const triggerTypes = await composio.triggers.listTypes({
            limit: 1000,
        })
returns extactly 106 items and that seem still short of the 140+ unique items retuns by the list enum endpoint. What would you advise? @User
I attached a list of the trigger ID not available via listTypes() but available via listEnum(). Also, they are available via the UI but not available via getType() which means you can't setup triggers via the API or SDK for them. https://cdn.discordapp.com/attachments/1435207979417993226/1435215913296072776/message.txt?ex=690bd13a&is=690a7fba&hm=bf9dec71183ad12026e32f1b036c99ecdb0bb9c10dabbc0d2cd5c95ca8169bc5&
@Uday Any help with this?
u
Hey @_paschal, we are checking this.
u
THank you.
@Uday Any update on this? Also, I have a little suggestion; right now a trigger can be created with a userId, and where a toolkit has multiple connections for the same userId, it uses the first one. Also, in the SDK it might make sense to trigger agents by specifying the connection ids instead of userId then toolkit ids. This doesn't offer control and makes it harder to design systems where connections can be re-used. At least for us, it forces us to 1-1 relationships between agents and toolkit connections.
a
Hey, this issue has been fixed.
u
@abhishekpatil4 , Thank you, I upgraded my SDKs and it is listed correctly now, however, when I try to create a trigger subscription, I get:
Copy code
❌ Workflow generation error: ComposioTriggerTypeNotFoundError: Trigger type GOOGLECALENDAR_GOOGLE_CALENDAR_EVENT_CREATED_TRIGGER not found
https://cdn.discordapp.com/attachments/1435207979417993226/1436026323436048516/image.png?ex=690e1b3b&is=690cc9bb&hm=f56cc15f8352029abb335a05e431970daabeeaecbe9c0a80afdc67ad3d262a24&
a
checking
u
@abhishekpatil4 Any update on this?
a
Hey, we found the issue and working on a fix, should be live soon. Here's the PR for reference: https://github.com/ComposioHQ/composio/pull/2150
u
Awesome, thank you.
@abhishekpatil4 Any update on this?
c
PR has been merged, I'll quickly confirm if this has fix has been included in the recent release and get back.
a
Hey, the latest SDK includes the fix, but there’s a minor issue with one of the APIs it uses. We’re already working on resolving it — sorry for the delay! I’ll update here as soon as it’s fixed. In the meantime, here’s the API reference for creating a trigger: https://docs.composio.dev/api-reference/triggers/post-trigger-instances-by-slug-upsert
u
Awesome. Thank you.
Hey @abhishekpatil4, Any update on this?
a
Hey, thanks for the follow-up. We found that the SDK needs a small update to work properly with the API. We're working on it now. You can track progress here: https://github.com/ComposioHQ/composio/issues/2174