Generated scenarios as opposed to crafted by hand

Hi,
Make provides an awesome fine-grained API that lets you create connections, scenarios etc. I can imagine for corporate clients it might be interesting to turn their internal services into Make modules and generate scenarios using these custom integrations. Is anyone using Make this way?

2 Likes

I’m not sure if the documentation has been updated in the last month, but a month ago I fooled around with it for a few hours but the documentation was not helping enough.

If you want to create scenarios based on json blueprints you will need to pass the blueprint as a string within json. But to get that working you might need to escape some characters. I couldn’t get a scenario built based upon the docs within the hour. Support also wasn’t helpful at the time, but that might have been due to the vast amount of tickets due to the Make release.

It would be awesome if they could release a short video or some screenshots with working code or update the API docs to show an exact example that works and explains how the string should be formatted within the payload.

It’s an awesome option indeed and I do have some use cases.

1 Like

@Arnoud_WorkNinjas thanks a lot for sharing your experience! Invaluable. I want to give it a try too and document my findings in the form of tutorials and vlogs. :crossed_fingers:

I’ve added an example of how to successfully create a scenario from your code.

The example is on my GitHub.

Regarding the escaping. Yes, it’s painful but unavoidable since you’re passing a JSON string within JSON object. In my implementation I took a different approach. Instead of escaping I pass the blueprint JSON as a base64-encoded string.

I’ve written a custom server that internally calls Make API. There are several advantages to this approach:

  1. Clarity. For example, it wasn’t obvious to me that in order to successfully create a scenario you also need to pass the folder and the team id, as well as scheduling.
  2. Monitoring and security. You can deploy the server and safely store the authentication token as an environment variable. You can also monitor for delays or downtimes on Make’s side of things.
  3. Graceful exception handling. If the Make API server is unresponsive you can schedule a retry (currently not implemented, but will add it soon).
  4. Custom response codes. For example, when you create a new scenario Make responds with 200 OK and gives you the full Scenario object. I’ve mapped this to 201 Created with only the scenario id.

I plan to add new endpoints that wrap around other calls to Make’s API: Connections, Data stores etc.

The server is currently written in my favourite language, Kotlin. I guess the community would probably also appreciate JavaScript, like node.js.

Appreciate your feedback and comments. Thank you.

1 Like

Addressed and created a new post here.