The Execute Workflow endpoint is the most commonly used API endpoint in Sliderule, and is typically called directly from your product's backend, in time sensitive situations. We've designed it to always avoid returning in an Error state, unless there are problems with the call itself (malformed token, no request body, permissions issue for your user account, etc)

Instead, we return an array of Warnings, both highlighted in the the frontend on all Execution Results, as well as returned in the JSON output of any affected Execution.

Warnings for Missing Fields

The most common type of warning is a that you're missing an expected field from the Input fields provided. When you click on Input block for your Workflow, you can mark the fields expected as Required in column two. If your input to Execute the Workflow does not include a required field, a Warning will be generated.

2788

For example, if you hit this sample Workflow missing the age and dob fields, your Execution will still complete, but with warnings attached.

{
 	"executionId": 0,
  "executionTemporaryId": "65f25f9d-d34b-409b-bb45-6683d6345546",    
  "warnings": [
        {
            "name": "Input",
            "rules": [
                {
                    "name": "Missing Required Fields",
                    "warning": "You have 2 missing required fields: \"age\", \"dob\""
                }
            ]
        }
    ],
    "result": "APPROVED",
    "reason": [],
    "dateEvaluated": "2022-05-20",
    "timeOfExecution": "2022-05-20T15:41:17.941Z",
    "duration": 18
}

Other Warning Types

Type Mismatch - you've created a field called income that is usually a number. If you pass in a string of "low income" for some new Execution, you'll get a mismatched type error