Create ML model training from API request

API toolRecipe Tools

What it does

When someone sends a new API request, this automation validates the ML connection and data configurations. It trains the model in Sagemaker and returns success or failure to confirm the outcome.

Who it's for

Data and analytics teams who need to train ML models through an API without manual setup.

How teams use this

Start model training from external systems

Send an API request with ML configs to start Sagemaker training without logging into the platform. The automation validates everything and trains the model in real time.

Automate retraining on a schedule

Integrate this API with a scheduler to retrain models on a cadence. The same validation and Sagemaker call runs each time without manual intervention.

Add approval before training starts

Include a condition to check if the model version is approved before calling Sagemaker. Only validated model configs proceed to training.

How it works

  1. Receive the API request. Define the request and response parameters for this API endpoint so the automation knows what data to expect and what to return.
  2. Set up ML configuration variables. Create variables for the ML connection profile, source data config, and target data config from the incoming request parameters in Workato Recipe Function.
  3. Validate configurations in lookup table. Search the AIML Model Profile lookup table for matching configurations. If any required config is missing, the automation stops and returns an error.
  4. Train the model in Sagemaker. Call the AIML Train ML Model Sagemaker function with the validated connection and data configs to start model training.
  5. Return the training status. Reply to the API request with success or failure so the caller knows whether model training started.