Problem
When having extensive flows I can’t easily connect multiple templates together in one use case/flow.
What I would like.
User ask question (case)
- Template A - Authorize user and create temporary access token for that user.
- Template B - API call - show list of entities and select entity (`/api/v1/entities/`)
- Template C - API call - show list of entities and select entity (`/api/v1/entities/id/items`)
- Template D - API call - present solution for entity item
What happens now;
Case; I have problem with item.
- Set `destination` parameter (D)
- Link to template A:
- On success → destination === D→ link to template B
- Template B:
- On success → destination === D → link to template C
- Template C;
- On success → destination === D → link to template C
- Template D;
- Answer question for user.
This creates dependencies between templates instead of a flexible flow you can plug between flows the D is now tied to B and can’t be use in a different case where I need to swap D with another case.
What I would prefer is a flow:
- Template A - Verify user
- Success: next flow step
- Fail: previous flow step
- Template B - API call - show list of entities and select entity (`/api/v1/entities/`)
- Success: next flow step
- Fail: previous flow step
- Template C - API call - show list of entities and select entity (`/api/v1/entities/id/items`)
- Success: nothing
- Fail: previous flow step
- Template D - API call - Analyze problem
I’ve currently built a OTP flow to authorize my users, since I don’t want to provide 1 api connection that can access my entire user base through the AI agent which can potentially access my entire dataset.
Instead I decided to build a custom oauth grant, but this is a major pain in the *** because I can’t use the default authorization for API integrations. So my way of trying to circumvent this
Template “authorization”
- Call API for sending OTP over email
- Call API with custom oauth grant containing OTP
- Trying to go to a next step for the actual API Integration with a stored accessToken
With the current system, this is a major pain to setup.
Another way to solve this is to not have a custom API integration for another API integration (auth only flow) but to have a template that serves as a auth flow to provide the ApiToken and ExpiresIn and asks the user the questions before calling the API Integration and stores tokens between integrations so active session can be re-used.