 {
  "tray_export_version": 4,
  "export_type": "workflow",
  "workflows": [
    {
      "id": "09a3201b-3de0-41b8-9156-9afc01d0d4c6",
      "created": "2025-04-17T16:36:26.777517Z",
      "workspace_id": "fe1dc357-73fd-4beb-a857-548679b2e439",
      "project_id": "fa4eca57-61cd-4d36-b947-a7484aff03c8",
      "group": "9a207f7e-08e8-43f0-a70d-2a5d2b61095d",
      "creator": "fe1dc357-73fd-4beb-a857-548679b2e439",
      "version": {
        "id": "c75d9d64-a76e-4def-b37e-5f81c5d29b0d",
        "created": "2025-05-02T19:14:22.812137Z"
      },
      "title": "Import Databricks Rows into Salesloft using CRM ID | SFDC",
      "description": "This workflow combines Databricks and Salesloft to create an Account-based signal workflow. \n\nUtilize a Databricks table with revenue-generating data for an Account and import that data into the corresponding Salesloft account. This workflow uses a CRM ID upsert action and updates a custom field that you created in the platform. Specifically made for Salesforce customers.",
      "enabled": false,
      "tags": [
        "Databricks",
        "Salesloft"
      ],
      "settings": {
        "config": {},
        "input_schema": {},
        "output_schema": {}
      },
      "steps_structure": [
        {
          "name": "trigger",
          "type": "normal",
          "content": {}
        },
        {
          "name": "databricks-1",
          "type": "normal",
          "content": {}
        },
        {
          "name": "loop-1",
          "type": "loop",
          "content": {
            "_loop": [
              {
                "name": "list-helpers-1",
                "type": "normal",
                "content": {}
              },
              {
                "name": "list-helpers-2",
                "type": "normal",
                "content": {}
              },
              {
                "name": "list-helpers-3",
                "type": "normal",
                "content": {}
              },
              {
                "name": "salesloft-3",
                "type": "normal",
                "content": {}
              }
            ]
          }
        }
      ],
      "steps": {
        "databricks-1": {
          "title": "Databricks Table Request",
          "description": "Executes a raw API request to the Databricks /sql/statements API to execute a SQL query. Ensure that your table contains CRM_ID and a custom value that pertains to your signal.\n\nUse a time-based query so that the same data is not processed twice.",
          "connector": {
            "name": "databricks",
            "version": "1.0"
          },
          "operation": "raw_http_request",
          "output_schema": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "properties": {
              "response": {
                "type": "object",
                "properties": {
                  "status_code": {
                    "type": "number"
                  },
                  "headers": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string"
                      },
                      "content-type": {
                        "type": "string"
                      },
                      "x-databricks-org-id": {
                        "type": "string"
                      },
                      "x-request-id": {
                        "type": "string"
                      },
                      "vary": {
                        "type": "string"
                      },
                      "strict-transport-security": {
                        "type": "string"
                      },
                      "x-content-type-options": {
                        "type": "string"
                      },
                      "server": {
                        "type": "string"
                      },
                      "alt-svc": {
                        "type": "string"
                      },
                      "connection": {
                        "type": "string"
                      },
                      "transfer-encoding": {
                        "type": "string"
                      }
                    }
                  },
                  "body": {
                    "type": "object",
                    "properties": {
                      "statement_id": {
                        "type": "string"
                      },
                      "status": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string"
                          }
                        }
                      },
                      "manifest": {
                        "type": "object",
                        "properties": {
                          "format": {
                            "type": "string"
                          },
                          "schema": {
                            "type": "object",
                            "properties": {
                              "column_count": {
                                "type": "number"
                              },
                              "columns": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type_text": {
                                      "type": "string"
                                    },
                                    "type_name": {
                                      "type": "string"
                                    },
                                    "position": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type_text",
                                    "type_name",
                                    "position"
                                  ]
                                }
                              }
                            }
                          },
                          "total_chunk_count": {
                            "type": "number"
                          },
                          "chunks": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "chunk_index": {
                                  "type": "number"
                                },
                                "row_offset": {
                                  "type": "number"
                                },
                                "row_count": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "total_row_count": {
                            "type": "number"
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        }
                      },
                      "result": {
                        "type": "object",
                        "properties": {
                          "chunk_index": {
                            "type": "number"
                          },
                          "row_offset": {
                            "type": "number"
                          },
                          "row_count": {
                            "type": "number"
                          },
                          "data_array": {
                            "type": "array",
                            "items": {
                              "type": "array"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "error_handling": {},
          "authentication": {
            "group": "180203ce-0fac-4272-9c03-064564b0c27d",
            "title": "AWS QA Databricks",
            "service_icon": {
              "icon_type": "url",
              "value": "//s3.amazonaws.com/images.tray.io/artisan/icons/a2ba5034-ea50-46f2-96a6-495c0b482840.png"
            },
            "scopes": [],
            "service_name": "databricks",
            "service_version": 1
          },
          "properties": {
            "method": {
              "type": "string",
              "value": "POST"
            },
            "include_raw_body": {
              "type": "boolean",
              "value": false
            },
            "parse_response": {
              "type": "string",
              "value": "true"
            },
            "url": {
              "type": "object",
              "value": {
                "full_url": {
                  "type": "string",
                  "value": "https://dbc-c3e036b7-840a.cloud.databricks.com/api/2.0/sql/statements"
                }
              }
            },
            "body": {
              "type": "object",
              "value": {
                "raw": {
                  "type": "string",
                  "value": "{\n  \"statement\": \"select * from turnpike.silver.account where crm_id is not null and team_id = 400089\",\n  \"wait_timeout\": \"50s\",\n  \"warehouse_id\": \"50f9ec136f8e777c\"\n}"
                }
              }
            }
          }
        },
        "list-helpers-1": {
          "title": "Retrieve CRM_ID from index",
          "description": "(Action Required) | Change the index value to point to the column in your database that returns the CRM ID.\n\nRetrieves the CRM_ID from the Databricks response. This value is needed for the Salesloft Upsert action.",
          "connector": {
            "name": "list-helpers",
            "version": "3.1"
          },
          "operation": "get_item_by_index",
          "output_schema": {},
          "error_handling": {},
          "properties": {
            "list": {
              "type": "jsonpath",
              "value": "$.steps.loop-1.value"
            },
            "index_error": {
              "type": "boolean",
              "value": false
            },
            "error_on_empty": {
              "type": "boolean",
              "value": false
            },
            "index": {
              "value": 31,
              "type": "integer"
            }
          }
        },
        "list-helpers-2": {
          "title": "Retreive Account Name ",
          "description": "(Optional) | If you're certain that your table will always contain records that exist in Salesloft, you can remove this step.\n\nRetrieves the Account Name from the Databricks response. Change the index value to point to the column in your database that returns the Account Name.",
          "connector": {
            "name": "list-helpers",
            "version": "3.1"
          },
          "operation": "get_item_by_index",
          "output_schema": {},
          "error_handling": {},
          "properties": {
            "list": {
              "type": "jsonpath",
              "value": "$.steps.loop-1.value"
            },
            "index_error": {
              "type": "boolean",
              "value": false
            },
            "error_on_empty": {
              "type": "boolean",
              "value": false
            },
            "index": {
              "value": 12,
              "type": "integer"
            }
          }
        },
        "list-helpers-3": {
          "title": "Retreive  Custom Value",
          "description": "(Action Required) | Change the index value to point to the column in your database that returns your signal value for the Account.\n\nRetrieves the Signal Value from the Databricks response. This value is needed for updating the custom field.",
          "connector": {
            "name": "list-helpers",
            "version": "3.1"
          },
          "operation": "get_item_by_index",
          "output_schema": {},
          "error_handling": {},
          "properties": {
            "list": {
              "type": "jsonpath",
              "value": "$.steps.loop-1.value"
            },
            "index_error": {
              "type": "boolean",
              "value": false
            },
            "error_on_empty": {
              "type": "boolean",
              "value": false
            },
            "index": {
              "value": 12,
              "type": "integer"
            }
          }
        },
        "loop-1": {
          "title": "Loop Databricks Results",
          "description": "Loops through the Databricks response",
          "connector": {
            "name": "loop",
            "version": "1.3"
          },
          "operation": "loop_array",
          "output_schema": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "properties": {
              "value": {
                "type": "array"
              },
              "count": {
                "type": "number"
              },
              "index": {
                "type": "number"
              },
              "is_first": {
                "type": "boolean"
              },
              "is_last": {
                "type": "boolean"
              },
              "branch_name": {
                "type": "string"
              }
            }
          },
          "error_handling": {},
          "properties": {
            "array": {
              "type": "jsonpath",
              "value": "$.steps.databricks-1.response.body.result.data_array"
            }
          }
        },
        "salesloft-3": {
          "title": "Account Upsert",
          "description": "(Action Required) | Update Custom Field Name & Review the mapped values. \n\nExecutes an upsert action in Salesloft. If the CRM_ID exists, the account will be updated. If it doesn't, the account will be created.\n\nIf a scope error occurs, re-authorize Salesloft.",
          "connector": {
            "name": "salesloft",
            "version": "3.0"
          },
          "operation": "raw_http_request",
          "output_schema": {},
          "error_handling": {},
          "authentication": {
            "group": "94745324-8900-47c7-a24a-939ce5a94f17",
            "title": "US4 Auth",
            "service_icon": {
              "icon_type": "url",
              "value": "//s3.amazonaws.com/images.tray.io/artisan/icons/4e949938-8c50-47ce-83ea-75d29a2af9ef.png"
            },
            "scopes": [],
            "service_name": "salesloft",
            "service_version": 1
          },
          "properties": {
            "access_token": {
              "type": "jsonpath",
              "value": "$.auth.access_token"
            },
            "method": {
              "type": "string",
              "value": "POST"
            },
            "include_raw_body": {
              "type": "boolean",
              "value": false
            },
            "parse_response": {
              "type": "string",
              "value": "true"
            },
            "url": {
              "type": "object",
              "value": {
                "full_url": {
                  "type": "string",
                  "value": "https://api.salesloft.com/v2/account_upserts"
                }
              }
            },
            "body": {
              "type": "object",
              "value": {
                "raw": {
                  "type": "object",
                  "value": {
                    "upsert_key": {
                      "type": "string",
                      "value": "crm_id"
                    },
                    "crm_id_type": {
                      "type": "string",
                      "value": "salesforce"
                    },
                    "crm_id": {
                      "type": "jsonpath",
                      "value": "$.steps.list-helpers-1.result",
                      "fallback": {
                        "value": "0018V00002PPTzCQAX",
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "jsonpath",
                      "value": "$.steps.list-helpers-2.result"
                    },
                    "custom_fields": {
                      "type": "object",
                      "value": {
                        "UNUSED_SEATS_PERCENTAGE": {
                          "type": "jsonpath",
                          "value": "$.steps.list-helpers-3.result"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "trigger": {
          "title": "Scheduled Trigger",
          "description": "Set up the trigger to run as often as needed.",
          "connector": {
            "name": "scheduled",
            "version": "3.5"
          },
          "operation": "weekly",
          "output_schema": {},
          "error_handling": {},
          "properties": {
            "synchronous": {
              "type": "boolean",
              "value": false
            },
            "public_url": {
              "type": "jsonpath",
              "value": "$.env.public_url"
            },
            "hour": {
              "type": "string",
              "value": "8"
            },
            "minute": {
              "type": "string",
              "value": "0"
            },
            "start_date": {
              "type": "string",
              "value": "2025-04-08 12:00"
            },
            "tz": {
              "type": "string",
              "value": "UTC"
            },
            "day_of_week": {
              "type": "string",
              "value": "1"
            }
          }
        }
      },
      "legacy_error_handling": true,
      "dependencies": []
    }
  ],
  "projects": []
}