auth = dmda.DomoTokenAuth(
    domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
    domo_instance=os.environ["DOMO_INSTANCE"],
)

await auth.who_am_i()

model_id = "48707704-213c-4c82-8a7d-69505b50a8de"
model_version_id = "1.0.9"
starting_tile = 'Start HelpDeskMafia'

fileset_id = "30d51a7e-15f9-4dce-8284-be392c392f2d"

Get domo workflow information


source

get_workflow

 get_workflow (auth:domolibrary.client.DomoAuth.DomoAuth, model_id:str,
               version_id:str, debug_api:bool=False,
               debug_num_stacks_to_drop=1, parent_class:str=None,
               session:httpx.AsyncClient=None)
res = await get_workflow(
    auth=auth, model_id=model_id, version_id=model_version_id, debug_api=False
)


res.response["savedJson"]
'{"version":2,"designElements":[{"id":"rootNode","type":"rootNode","position":{"x":60,"y":30},"data":{"dimensions":{"width":200,"height":60},"title":"Start HelpDeskMafia","description":"","type":"Start","_designNode":"rootNode","isFormStart":true,"input":[{"acceptsInput":true,"children":[],"customMappingType":"form_start","dataType":"text","datasetMapping":null,"displayName":"channel_id","entitySubType":null,"fieldOptionsMappedTo":null,"fieldOptionsValue":null,"flag":"input","formFieldId":"f8fd5581-9f00-493e-8436-050f2a7dc5d5","formFieldType":null,"id":"mLIkhJAYwdDGwfB","isList":false,"mappedTo":"AYTjlyjbwFiAdPY","paramName":"channel_id","required":true,"value":null,"visible":true,"configType":"forms","useExternalValues":false},{"acceptsInput":false,"children":[],"customMappingType":"form_start","dataType":"text","datasetMapping":null,"displayName":"message_id","entitySubType":null,"fieldOptionsMappedTo":null,"fieldOptionsValue":null,"flag":"input","formFieldId":"5aab7003-af7d-4d10-87a9-5c9e5d5449e1","formFieldType":null,"id":"tOZEHRLEhtaeaQC","isList":false,"mappedTo":"DYkPHsxZPSejNfE","paramName":"message_id","required":true,"value":null,"visible":true,"configType":"forms","useExternalValues":false},{"acceptsInput":false,"children":[],"customMappingType":"form_start","dataType":"text","datasetMapping":null,"displayName":"question","entitySubType":null,"fieldOptionsMappedTo":null,"fieldOptionsValue":null,"flag":"input","formFieldId":"33f92899-9cab-4133-b325-68ac09fce0e6","formFieldType":null,"id":"JzlUAnZVSryLCcz","isList":false,"mappedTo":"dNTcpVEMOjNotdS","paramName":"question","required":true,"value":null,"visible":true,"configType":"forms","useExternalValues":false},{"acceptsInput":false,"children":[],"customMappingType":"form_start","dataType":"text","datasetMapping":null,"displayName":"slack_token","entitySubType":null,"fieldOptionsMappedTo":null,"fieldOptionsValue":null,"flag":"input","formFieldId":"805a1f64-8c29-4d52-b5f7-685cb529f05a","formFieldType":null,"id":"gwSPxsDrBYHQDDu","isList":false,"mappedTo":"IuRfyDahKVKKGmH","paramName":"slack_token","required":true,"value":null,"visible":true,"configType":"forms","useExternalValues":false},{"acceptsInput":false,"children":[],"customMappingType":"form_start","dataType":"text","datasetMapping":null,"displayName":"user_id","entitySubType":null,"fieldOptionsMappedTo":null,"fieldOptionsValue":null,"flag":"input","formFieldId":"c127085f-9c02-4358-9e2a-53580a125102","formFieldType":null,"id":"EsQSgxahEhWDtpE","isList":false,"mappedTo":"KUNnCpGrFwdWRtc","paramName":"user_id","required":true,"value":null,"visible":true,"configType":"forms","useExternalValues":false}],"output":[],"formId":"7fc43166-fbf2-40c7-ae90-e770f9c84324","formTitle":"null","formDescription":"null"},"style":{"zIndex":3,"outline":"none"},"index":0},{"id":"zXTsAKikLbRiJaK","type":"AI_AGENT","position":{"x":60,"y":210},"data":{"dimensions":{"width":200,"height":60},"title":"FindKB Article","description":"This agent takes an input question and attempts to locate the most likely KB article and answer.","prompt":{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"Prompt","entitySubType":null,"flag":"input","id":"JveXnPQIDjKkKVr","isList":false,"mappedTo":null,"paramName":"prompt","required":true,"value":[{"type":"paragraph","children":[{"text":"{","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"question: ","bold":false,"italic":false,"underlined":false,"sql":false},{"type":"variable","children":[{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}],"dataType":"text","id":"dNTcpVEMOjNotdS","name":"question","isList":false},{"text":",","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"channelId: ","bold":false,"italic":false,"underlined":false,"sql":false},{"type":"variable","children":[{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}],"dataType":"text","id":"AYTjlyjbwFiAdPY","name":"channel_id","isList":false},{"text":",","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"threadTs: ","bold":false,"italic":false,"underlined":false,"sql":false},{"type":"variable","children":[{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}],"dataType":"text","id":"DYkPHsxZPSejNfE","name":"message_id","isList":false},{"text":",","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"userId: ","bold":false,"italic":false,"underlined":false,"sql":false},{"type":"variable","children":[{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}],"dataType":"text","id":"KUNnCpGrFwdWRtc","name":"user_id","isList":false},{"text":",","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"slack_token: ","bold":false,"italic":false,"underlined":false,"sql":false},{"type":"variable","children":[{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}],"dataType":"text","id":"IuRfyDahKVKKGmH","name":"slack_token","isList":false},{"text":"","bold":false,"italic":false,"underlined":false,"sql":false}]},{"type":"paragraph","children":[{"text":"}","bold":false,"italic":false,"underlined":false,"sql":false}]}],"visible":true,"engineName":"prompt"},"inputMessages":null,"outputMessages":null,"result":{"children":[{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"","entitySubType":null,"flag":"output","id":"xOOhKMnJXxmqdds.hdQCvMlTZolGVuc","isList":false,"mappedTo":"HXSADrsjrvFEFlo.EjpBMJacbpylcrJ.wvSdjyfCghmhzCm","paramName":"answer","required":true,"value":null,"visible":true,"engineName":"result.answer"}],"configType":null,"customMappingType":null,"dataType":"object","displayName":"Result","entitySubType":null,"flag":"output","id":"xOOhKMnJXxmqdds","isList":false,"mappedTo":"HXSADrsjrvFEFlo","paramName":"result","required":true,"value":null,"visible":true,"engineName":"result"},"agent":{"instructions":"Please identify the top 10 paragraphs from the vectorDB and then attempt to answer the user\'s question from the source information only.\\n\\nIf you don\'t get a good answer on the first try, you can expand the search space (number of paragraphs to looks at) and try different more descriptive variations of the users question.\\n\\nCan you summarize your response to under 200 characters. Please ensure that you include the attempted answer and any relevant urls from the knowledge base that you used to come up with the response.\\n\\nPlease then reply to the slack channel based on the provided channelId and timestamp.","tools":[{"packageId":"9a2f8f7a-b0bd-49d6-8bc7-641453b3df24","packageVersion":"1.0.0","functionName":"queryIndex","functionDescription":"function queries knowledge base articles and returns the most relevant paragraphs from these articles; ","inputs":[{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"indexId","entitySubType":null,"flag":"input","id":"sJZakmCPIdurjzL","isList":false,"mappedTo":null,"paramName":"indexId","required":true,"value":"helpdeskmafia","visible":true,"engineName":"indexId"},{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"input","entitySubType":null,"flag":"input","id":"UCrudlbIeOKxlVa","isList":false,"mappedTo":null,"paramName":"input","required":true,"value":null,"visible":true,"engineName":"input"},{"children":[],"configType":null,"customMappingType":null,"dataType":"number","displayName":"topK","entitySubType":null,"flag":"input","id":"qIYmXCItMfGMsns","isList":false,"mappedTo":null,"paramName":"topK","required":true,"value":null,"visible":true,"engineName":"topK"}],"inputDescriptions":{"UCrudlbIeOKxlVa":"Input question","qIYmXCItMfGMsns":"number of results to return","sJZakmCPIdurjzL":""},"output":{"children":[],"configType":null,"customMappingType":null,"dataType":"object","displayName":"response","entitySubType":null,"flag":"output","id":"DrtlkvILZCroYJd","isList":false,"mappedTo":null,"paramName":"response","required":false,"value":null,"visible":true,"engineName":"response"},"id":"mbdUjBxtDvCRxcx","name":"Query Index","type":"CODE_ENGINE_FUNCTION","description":"function queries knowledge base articles and returns the most relevant paragraphs from these articles; "},{"packageId":"0a482758-4e5b-48d6-b83f-00e3f700c51c","packageVersion":"1.0.0","functionName":"send_threaded_message","functionDescription":"This function sends a message and tags a user on slack. ","inputs":[{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"user_id","entitySubType":null,"flag":"input","id":"grAdOBRHItPIRIy","isList":false,"mappedTo":null,"paramName":"user_id","required":true,"value":null,"visible":true,"engineName":"user_id"},{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"channel_id","entitySubType":null,"flag":"input","id":"cALYAhQqPXMkzWU","isList":false,"mappedTo":null,"paramName":"channel_id","required":true,"value":null,"visible":true,"engineName":"channel_id"},{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"slack_token","entitySubType":null,"flag":"input","id":"eceLkoBpqODhLBQ","isList":false,"mappedTo":null,"paramName":"slack_token","required":true,"value":null,"visible":true,"engineName":"slack_token"},{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"thread_ts","entitySubType":null,"flag":"input","id":"tcfvZgwXxZobaVK","isList":false,"mappedTo":null,"paramName":"thread_ts","required":true,"value":null,"visible":true,"engineName":"thread_ts"},{"children":[],"configType":null,"customMappingType":null,"dataType":"text","displayName":"message","entitySubType":null,"flag":"input","id":"hzrOeWZIMHzjwnF","isList":false,"mappedTo":null,"paramName":"message","required":true,"value":null,"visible":true,"engineName":"message"}],"inputDescriptions":{"cALYAhQqPXMkzWU":"Channel Id","eceLkoBpqODhLBQ":"slack token","grAdOBRHItPIRIy":"User Id","hzrOeWZIMHzjwnF":"Answer to users question","tcfvZgwXxZobaVK":"Message Id / Timestamp"},"output":{"children":[],"configType":null,"customMappingType":null,"dataType":"object","displayName":"result","entitySubType":null,"flag":"output","id":"sLzdHSFCjkyBVxD","isList":false,"mappedTo":null,"paramName":"result","required":false,"value":null,"visible":true,"engineName":"result"},"id":"FMFJkQjPssyUcIi","name":"Send Threaded Message","type":"CODE_ENGINE_FUNCTION","description":"This function sends a message and tags a user on slack. "}],"runTool":true,"isSolver":false,"outputDescriptions":{"xOOhKMnJXxmqdds":"answer to the users question"}},"_designNode":"AI_AGENT"},"style":{"zIndex":4,"outline":"none"},"index":1},{"id":"pYNRmCuxDmpzzJT","type":"endNode","position":{"x":60,"y":380},"data":{"dimensions":{"width":200,"height":60},"title":"End","description":"","_designNode":"endNode","terminating":false},"style":{"zIndex":3,"outline":"none"},"index":2},{"id":"edge-rootNode-zXTsAKikLbRiJaK-zxIhHYnIilZwVpp","type":"defaultEdge","source":"rootNode","target":"zXTsAKikLbRiJaK","data":{"sourcePosition":"bottom","targetPosition":"top","path":[[160,90],[160,209]],"title":""},"style":{"zIndex":5},"index":3,"arrowHeadType":"arrow"},{"id":"edge-zXTsAKikLbRiJaK-pYNRmCuxDmpzzJT-XlxdzsTfXywlyNd","type":"defaultEdge","source":"zXTsAKikLbRiJaK","target":"pYNRmCuxDmpzzJT","data":{"sourcePosition":"bottom","targetPosition":"top","path":[[160,270],[160,379]],"title":""},"style":{"zIndex":5},"index":4,"arrowHeadType":"arrow"}],"dataList":[{"id":"AYTjlyjbwFiAdPY","paramName":"channel_id","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null},{"id":"DYkPHsxZPSejNfE","paramName":"message_id","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null},{"id":"dNTcpVEMOjNotdS","paramName":"question","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null},{"id":"HXSADrsjrvFEFlo","paramName":"result","dataType":"object","isList":false,"children":[{"id":"HXSADrsjrvFEFlo.EjpBMJacbpylcrJ.wvSdjyfCghmhzCm","paramName":"answer","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null}],"showChildren":false,"entitySubType":null,"value":null},{"id":"IuRfyDahKVKKGmH","paramName":"slack_token","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null},{"id":"KUNnCpGrFwdWRtc","paramName":"user_id","dataType":"text","isList":false,"children":[],"showChildren":false,"entitySubType":null,"value":null}]}'

Trigger domo workflows


source

trigger_workflow

 trigger_workflow (auth:domolibrary.client.DomoAuth.DomoAuth,
                   starting_tile:str, model_id:str, version_id:str,
                   execution_parameters:dict=None, debug_api:bool=False,
                   debug_num_stacks_to_drop=1, parent_class:str=None,
                   session:httpx.AsyncClient=None)

source

generate_trigger_workflow_body

 generate_trigger_workflow_body (starting_tile, model_id, version_id,
                                 execution_params:dict)

Sample trigger workflows

  • Requires execution parameters (question that will be asked of agent)
  • Requires starting tile name
execution_params = {
        "question": "abc",
        "channel_id": "123",
        "message_id": "456",
        "user_id": "xqr",
        "slack_token": "abc"
    }

try:
    print(await trigger_workflow(
        auth=auth,
        starting_tile=starting_tile,
        model_id=model_id,
        version_id=model_version_id,
        execution_parameters= execution_params,
        debug_api=True,
    ))

except dmde.RouteError as e:
    print(e)
🐛 debugging get_data
{'body': {'data': {'channel_id': '123',
                   'message_id': '456',
                   'question': 'abc',
                   'slack_token': 'abc',
                   'user_id': 'xqr'},
          'messageName': 'Start HelpDeskMafia',
          'modelId': '48707704-213c-4c82-8a7d-69505b50a8de',
          'version': '1.0.9'},
 'function_name': 'get_traceback',
 'headers': {'Connection': 'keep-alive',
             'Content-Type': 'application/json',
             'accept': 'application/json, text/plain',
             'x-domo-developer-token': '83ece44f1451d4b581e1191f98cd411164f0b5b6ad2755b3'},
 'method': 'POST',
 'params': None,
 'parent_class': None,
 'url': 'https://domo-community.domo.com/api/workflow/v1/instances/message'}
get_data: sending json
get_data_response <Response [200 OK]>
ResponseGetData(status=200, response={'id': '303589d1-c1d2-40c2-887f-e7bf91a82b5a', 'modelId': '48707704-213c-4c82-8a7d-69505b50a8de', 'deploymentId': 'c1f54189-99f4-4394-abc9-fcaa526b0d0a', 'modelName': 'HelpDeskMafia', 'modelVersion': '1.0.9', 'bpmnProcessId': 'Process_48707704-213c-4c82-8a7d-69505b50a8de_1.0.9_1', 'bpmnProcessName': 'mmmm-0012-0200 HelpDeskMafia 1.0.9 1', 'createdBy': '1893952720', 'createdOn': '2025-03-28T20:16:47.859Z', 'updatedBy': '1893952720', 'updatedOn': '2025-03-28T20:16:47.859Z', 'status': 'IN_PROGRESS', 'isTestRun': False}, is_success=True, parent_class=None)

Get domo workflow trigger history and executions


source

get_workflow_trigger_history

 get_workflow_trigger_history (auth:domolibrary.client.DomoAuth.DomoAuth,
                               model_id:str, debug_api:bool=False,
                               debug_num_stacks_to_drop=1,
                               parent_class:str=None,
                               session:httpx.AsyncClient=None)
try:
    await get_workflow_trigger_history(auth=auth, model_id=model_id, debug_api=False)

except Exception as e:
    pass

source

get_workflow_executions

 get_workflow_executions (auth:domolibrary.client.DomoAuth.DomoAuth,
                          model_id:str, version_id:str,
                          debug_api:bool=False,
                          debug_num_stacks_to_drop=1,
                          parent_class:str=None,
                          session:httpx.AsyncClient=None)
res = await get_workflow_executions(
    auth=auth, model_id=model_id, version_id=model_version_id, debug_api=False
)

res.response[:1]
[{'id': '4cc9ce77-201a-450a-8ea4-be19a2eefea6',
  'processKey': 2251800299312120,
  'eventId': '33a35944-c20f-4971-b843-65a6fce792a8',
  'modelName': 'HelpDeskMafia',
  'modelId': '48707704-213c-4c82-8a7d-69505b50a8de',
  'modelVersion': '1.0.9',
  'triggerId': '4c59695f-eb7a-4933-80b4-5c0c46b95289',
  'triggerType': 'MANUAL',
  'triggerName': 'Manual Trigger',
  'triggerDeletedOn': None,
  'status': 'COMPLETED',
  'isTestRun': False,
  'createdAt': '2025-03-18T00:53:42.878Z',
  'startedBy': '475856860',
  'startedAt': '2025-03-18T00:53:42.878Z',
  'updatedAt': '2025-03-18T00:54:08.148Z',
  'updatedBy': '475856860',
  'finishedAt': '2025-03-18T00:54:08Z'}]