Are you able to set those Status and HTTPheaders straight into the instance of EnsLib.HTTP.GenericMessage in your code. like below

Set httpGeneric = ##Class(EnsLib.HTTP.GenericMessage).%New() ; this was already initiated in your business host via code.
set att("Status")=..#HTTP400BADREQUEST
do httpGeneric.SetAttributes(.att)
set httpHeader("ContentType")="application/json"
set httpHeader("totalcount")=totalcount
do httpGeneric.SetHTTPHeaders(.httpHeader)

Hello Warren,

You can use "Schedule Specifications" in production to schedule running your business host. First select your business host(service) and go to additional setting and check "Schedule" option click the magnifier. It opens the "Schedule Spec Editor" and create your schedule ex: "monthend_9to930" and click add action. Then select START and STOP action this action is basically "action:YYYY-MM-DDThh:mm:ss" . Refer the below sample and documentation

START *-*-31T09:00:00
STOP *-*-31T09:30:00

Note: this is suitable only for 31 days of month

anyway when I keep my native python scripts under "IRISinstalldirectory\mgr\python" and import my code as module and it's working because it's running inside the IRIS not using the python "driver" 

ClassMethod CallPyscripts()
{
    set ap = "mypyap"
    set pyImport = ##class(%SYS.Python).Import(ap)
    set builtin = $SYSTEM.Python.Builtins()
    do builtin.help(pyImport)
    write pyImport.irisversion,!
    write pyImport."Execute_Classmethod1"()
}
#__init__.py
import iris
from .irisembdpyth2024 import *

irisversion = iris.execute('return $zv')

# irisembdpyth2024.py file
import iris

def Execute_Classmethod1():
    print(iris.cls('MyLearn.EmbeddedPython').test1())

Hello @Guillaume Rongier

Thanks for the feedback! I go over your pretty useful article. I just write python code inside the ObjectScript itself by using language mode because of it's small code snippets. I actually facing some issues while writing IRIS in native python script.

From my pervious community question. First I install this intersystems_irispython-3.2.0-py3-none-any.whl in python and there is no cls, execute, routine, gref, ref or other IRIS script functions available.

As you recommend from the post. I install the official driver  https://github.com/intersystems-community/intersystems-irispython/releases/download/3.8.0/intersystems_iris-3.8.0-py3-none-any.whl file and I could use the IRIS functions for embedded python cls, execute, routine, gref, ref etc...

However, I got this ImportError: DLL load failed while importing pythonint: The specified module could not be found." error while executing the .py scripterror while executing my script

script is nothing but simple class method invocation.

import iris
def Execute_Classmethod():
    print(iris.cls('MyLearn.EmbeddedPython').test1())

Execute_Classmethod()