Programmatically Executing Waypoint

Hey, I want to build a nodejs script to programmatically execute Waypoint. I see I have at least 2 ways of doing that:

  1. Using the “ui/app/services/api.ts” to execute Waypoint directly using gRPC. The challenge on that is adapting those functions for a server since it’s built for a frontend ember app.
  2. Running the CLI directly using the ‘child_process’ module of nodejs. This is definitely the easiest, but I imagine there are some drawbacks.

Want to see if anyone that is more experienced with the platform has any options on the best path going forward with this.

HI bnrosa,

Depending in your use-case, you might prefer to use the CLI process. During a normal waypoint up, the CLI initiates the server “up” action, but also acts as a local runner to perform the operation. You could start the operation via the API, but you’d need to have a valid remote runner configured with the right credentials to perform your task.

If you’re really interested in using the server API directly from nodejs, we’d probably recommend you start by trying grpc-js and copying our server.proto and api-common-protos as this tutorial describes. We haven’t hardened our APIs yet for third-party usage yet (i.e. optimized error messages, checked extensively for remote panics, etc), but if you’re still interested and give this a shot let us know how it goes!

We’d also be curious to hear more about your use-case in general. Thanks for your interest!

1 Like