# Exploration Step Function Runner lambda
It runs Step Functions for disassemble_content_status records which are in `QUEUED` status.

## Lambda Environment variables
To execute Lambda the following environment variables must be configured:

| Variable                    | Description                                      
|-----------------------------|-----------------------------------------------------------
| `ENVIRONMENT`               | Environment name (`prod`, `dev`)                 
| `SF_ARN`                    | Step function arn to start Exploration flow      
| `EXP_CONFIG_PATH`           | Path to config with databricks params            
| `DEST_BUCKET`               | Bucket where to land data during the flow                                    
| `RDS_SECRETS_KEY`           | Path to database credentials in AWS Secret Manager                                   
| `MAX_ACTIVE_RUNS_DBX`       | Max active runs for databricks job                                  
| `MAX_ACTIVE_RUNS_TOTAL`     | Max total active runs(databricks flow + small files archive flow)                                  
| `MAX_FILESIZE_NOT_SPLIT`    | Files bigger than this will be splitted using databricks                                    

Note: `MAX_ACTIVE_RUNS` applies for files bigger than `MAX_FILESIZE_NOT_SPLIT` size, other files
will not use databricks flow so we start SF for them skipping any limitations.


## Lambda Output
In case of successful lambda execution the following output will be provided:
```json
{
    "meta": {
        "status": "OK"
    }
}
```

If any kind of exception occurred, the response will look like the following:
```json
{
    "meta": {
        "status": "FAILURE",
        "message": <exception message>
    }
}
```
