Make

    In the new boilerplate, you can create AI Agents with a Low-Code solution using Make API
    If you want to use MAKE API - you need to buy any paid plan, as there is no possibility to work with API in free plan
    Environment variables
    1. Log in to your Make account
    2. Copy your company ORGANIZATION ID and paste in .env
    make1

    .env

  1. MAKE_ORGANIZATION_ID=
  2. 3. Copy your TEAM ID and paste in .env
    make2

    .env

  3. MAKE_TEAM_ID=
  4. 4. Create your API KEY here and paste in .env
    To use MAKE API - you need to buy any paid plan, as there is no possibility to work with API in free plan
    make3

    .env

  5. MAKE_API_KEY=
  6. 5. Copy your MAKE URL, add a /api/v2 and paste in .env
    make4

    .env

  7. MAKE_API_URL=https://eu2.make.com/api/v2
  8. Scenario templates
    1. Create a new scenario in Make
    If you want to communicate with your scenario via HTTP requests, your scenario must start and end with the Webhook module (gateway-webhook)
    2. Add your scenario data to the scenarios/page.tsx availableScenarios like this:

    scenarios/page.tsx

  9. const availableScenarios: ScenarioTemplate[] = [
  10. {
  11. id: yourScenarioId,
  12. image: '/yourScenarioImage.png',
  13. name: 'yourScenarioName',
  14. description: 'yourScenarioDescription',
  15. fields: ['yourScenarioFields'],
  16. route: '/api/scenarios/yourScenarioName',
  17. },
  18. ]
  19. 3. Create a new route in app/api/scenarios. You must specify each connection and the initial webhook, if any. Like this:

    • Connection is created like this:

    app/api/scenarios/yourScenarioName.ts

  20. // 1. Create OpenAI connection
  21. const connectionResponse = await axios.post(
  22. 'BASE_URL/connections?teamId=MAKE_TEAM_ID',
  23. {
  24. accountName: 'OpenAI date',
  25. accountType: 'openai-gpt-3',
  26. apiKey: apiKey,
  27. apiOrg: apiOrg,
  28. },
  29. { headers: { Authorization: 'Token MAKE_API_KEY' } }
  30. )
  31. const connectionId = connectionResponse.data.connection.id
  32. if (!connectionId) {
  33. throw new Error('Connection ID missed')
  34. }
  35. • Webhook is created like this:

    app/api/scenarios/yourScenarioName.ts

  36. // 2. Create webhook for receiving messages
  37. const webhookResponse = await axios.post(
  38. 'BASE_URL/hooks?teamId=MAKE_TEAM_ID',
  39. {
  40. name: 'webhook openAI date',
  41. team_id: MAKE_TEAM_ID,
  42. teamId: MAKE_TEAM_ID,
  43. typeName: 'gateway-webhook',
  44. method: true,
  45. headers: true,
  46. stringify: false,
  47. interface: [{ name: 'message', type: 'text' }],
  48. },
  49. { headers: { Authorization: 'Token MAKE_API_KEY' } }
  50. )
  51. const webhookId = webhookResponse.data.hook.id
  52. const webhookLink = webhookResponse.data.hook.url
  53. if (!webhookId || !webhookLink) {
  54. throw Error('hook creating error')
  55. }
  56. 4. GET a blueprint of your scenario from /scenarios/SCENARIO_ID/blueprint

    app/api/scenarios/yourScenarioName.ts

  57. // 3. Get the blueprint of the source scenario
  58. const blueprintResponse = await axios.get(
  59. 'BASE_URL/scenarios/scenarioId/blueprint',
  60. {
  61. headers: { Authorization: 'Token MAKE_API_KEY' },
  62. }
  63. )
  64. const blueprint = blueprintResponse.data.response.blueprint
  65. const flow = blueprint.flow as FlowModule[]
  66. 5. Update a blueprint of your scenario to new connections and webhooks

    app/api/scenarios/yourScenarioName.ts

  67. // 4. Update module configurations in the flow
  68. const updatedFlow = flow.map(module => {
  69. // Update webhook module with new webhook ID
  70. if (module.module === 'gateway:CustomWebHook') {
  71. return {
  72. ...module,
  73. parameters: {
  74. ...module.parameters,
  75. hook: webhookId,
  76. },
  77. }
  78. }
  79. // Update OpenAI module with new connection and assistant ID
  80. if (module.module === 'openai-gpt-3:messageAssistantAdvanced') {
  81. return {
  82. ...module,
  83. parameters: {
  84. ...module.parameters,
  85. __IMTCONN__: connectionId,
  86. },
  87. mapper: {
  88. ...module.mapper,
  89. assistantId: assistantId,
  90. },
  91. }
  92. }
  93. return module
  94. })
  95. 6. Create new scenario using new blueprint and synchronize it with Database
    Interaction with functionality
    If your trigger module is a getaway-webhook, you get a link to which you can send requests. The boilerplate already has a trial version of chat with scenario /chat/projectID/page.tsx