{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Getting Workflow Objects","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getting-workflow-objects","__idx":0},"children":["Getting Workflow Objects"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data provides an API that you can use to view the details of a particular workflow outside of the Treasure Console. Figure 1 below shows an example of a workflow object returned by the API. Schedule information for the workflow, including start and end dates, is shown in lines 16-20."," ","You can get a list of the workflow objects that are in Treasure Data by calling this RESTful endpoint:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.treasuredata.com/api/workflows"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The workflow objects that are returned by this call contain both the ID of a workflow and the schedule information for the workflow (see Figure 1)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can call this endpoint with the following parameters:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["No parameters–This will return 200 workflow objects starting with the lowest numbered ID. This is only a good option if you have few workflows defined in the system."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["count--This limits the results returned to a specified number. While this overcomes the default limitation of 200 workflow objects, specifying a large count can significantly delay the response and require additional time to parse the results. count is defined as an int32 so you can specify over 2 million objects."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["last_id–This limits the results to the first 200 workflow objects whose IDs are greater than the specified number. This can be useful if you have a general idea of how what your workflow ID numbers are. For example, if your current workflow IDs look something like this 3456, you could set last_id to approximately 3400 to limit the results of the call."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["name_pattern–This will limit the results to workflow objects whose names match the pattern you specify. If you follow a workflow object naming convention, or if you have an idea of what a workflow was named, this is the most efficient way of displaying workflow objects."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The format of the response is unformatted JSON. However, for the sake of readability, the responses in the examples below are piped through a JSON formatting tool."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-of-calling-the-api-with-count","__idx":1},"children":["Example of Calling the API with count"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -H 'Authorization: TD1 ${TD_API_KEY}' \\\n'https://api.treasuredata.com/api/workflows/?count=2000' | python -m json.tool\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"workflows\": [\n      {\n          \"id\": \"334\",\n          \"name\": \"myredshift\",\n          \"project\": {\n              \"id\": \"14\",\n              \"name\": \"myredshift\"\n          },\n          \"revision\": \"a56dfb4e8eca3214ad520b45b2c2d1ea\",\n          \"timezone\": \"UTC\",\n          \"config\": {\n              \"_export\": {\n                  \"user\": \"awsuser\",\n                  \"host\": \"td.ckw8m7vbvvvn.us-east-1.td.amazonaws.com\",\n                  \"database\": \"digdag_test\",\n                  \"table\": \"td_wf_prod_test\"\n              },\n              \"+prepare_table\": {\n                  \"redshift>\": \"queries/create_table.sql\"\n              },\n              \"+load_data\": {\n                  \"redshift_load>\": null,\n                  \"from\": \"s3://digdag-test/td-workflow-test/testdata.csv.gz\",\n                  \"delimiter\": \",\",\n                  \"gzip\": true\n              },\n              \"+increament_count\": {\n                  \"redshift>\": \"queries/increment_count.sql\"\n              },\n              \"+unload_data\": {\n                  \"redshift_unload>\": null,\n                  \"query\": \"select * from ${table}\",\n                  \"to\": \"s3://digdag-test/td-workflow-test/testdata.csv.gz\",\n                  \"allowoverwrite\": true,\n                  \"delimiter\": \",\",\n                  \"gzip\": true\n              }\n          }\n      },\n      {\n          \"id\": \"349\",\n          \"name\": \"simple_workflow\",\n          \"project\": {\n              \"id\": \"123\",\n              \"name\": \"TestUI\"\n          },\n.\n.\n.\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-calling-the-api-with-last_id","__idx":2},"children":["Example Calling the API with last_id"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -H 'Authorization: TD1 1/123456789abcdef0123456789abcdef012345678' 'https://api.treasuredata.com/api/workflows/?last_id=7828860' | python -m json.tool\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"workflows\": [\n      {\n          \"id\": \"7828866\",\n          \"name\": \"wtt_workflow\",\n          \"project\": {\n              \"id\": \"234567\",\n              \"name\": \"wtt_workflow\"\n          },\n          \"revision\": \"ce2a35ae71a442b6abb3274551fe1692\",\n          \"timezone\": \"UTC\",\n          \"config\": {\n              \"_export\": {\n                  \"td\": {\n                      \"database\": \"dbname.table\"\n                  }\n              },\n              \"schedule\": {\n                  \"start\": \"2022-04-27\",\n                  \"minutes_interval>\": 30,\n                  \"end\": \"2022-04-30\"\n              },\n              \"+task1\": {\n                  \"td_load>\": \"my_transfer_unique_id\"\n              },\n              \"+task2\": {\n                  \"td_run>\": \"my_saved_query\"\n              }\n          }\n      },\n      {\n          \"id\": \"7829021\",\n          \"name\": \"syndication\",\n          \"project\": {\n              \"id\": \"263789\",\n              \"name\": \"journey_6543\"\n          },\n.\n.\n.\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-calling-the-api-with-name_pattern","__idx":3},"children":["Example Calling the API with name_pattern"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -H 'Authorization: TD1 ${TD_API_KEY}' \\\n'https://api.treasuredata.com/api/workflows/?name_pattern=wtt' | python -m json.tool\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"workflows\": [\n      {\n          \"id\": \"7828866\",\n          \"name\": \"wtt_workflow\",\n          \"project\": {\n              \"id\": \"234567\",\n              \"name\": \"wtt_workflow\"\n          },\n          \"revision\": \"ce2a35ae71a442b6abb3274551fe1692\",\n          \"timezone\": \"UTC\",\n          \"config\": {\n              \"_export\": {\n                  \"td\": {\n                      \"database\": \"dbname.table\"\n                  }\n              },\n              \"schedule\": {\n                  \"start\": \"2022-04-27\",\n                  \"minutes_interval>\": 30,\n                  \"end\": \"2022-04-30\"\n              },\n              \"+task1\": {\n                  \"td_load>\": \"my_transfer_unique_id\"\n              },\n              \"+task2\": {\n                  \"td_run>\": \"my_saved_query\"\n              }\n          }\n      }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"getting-workflow-objects-by-id","__idx":4},"children":["Getting Workflow Objects by ID"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you want the API to just return one workflow object, you can call the API using a workflow object ID. All of the examples provided above return the ID of the workflow objects. However you can also determine a workflow ID using the Treasure Console:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the Treasure Console navigate to Workflows."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Scroll through the list, or search the list, for your workflow and select it."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ID of the workflow appears in the URL of the browser. In the example below, the workflow ID for the wtt_workflow is 7828866."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/workflowid2.7f2d10aafae23fe040ff052cbc606e5fed4651a3def7bae6b3c20b4b26c1ba31.2e4f387b.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After you have the ID for the workflow, you can make the API call like this:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -H 'Authorization: TD1 ${TD_API_KEY}' \\\n'https://api.treasuredata.com/api/workflows/7828866' | python -m json.tool\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"7828866\",\n  \"name\": \"wtt_workflow\",\n  \"project\": {\n      \"id\": \"234567\",\n      \"name\": \"wtt_workflow\"\n  },\n  \"revision\": \"ce2a35ae71a442b6abb3274551fe1692\",\n  \"timezone\": \"UTC\",\n  \"config\": {\n      \"_export\": {\n          \"td\": {\n              \"database\": \"dbname.table\"\n          }\n      },\n      \"schedule\": {\n          \"start\": \"2022-04-27\",\n          \"minutes_interval>\": 30,\n          \"end\": \"2022-04-30\"\n      },\n      \"+task1\": {\n          \"td_load>\": \"my_transfer_unique_id\"\n      },\n      \"+task2\": {\n          \"td_run>\": \"my_saved_query\"\n      }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Figure 1: Example of a basic Treasure workflow object"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":" {\n  \"id\": \"7828866\",\n  \"name\": \"wtt_workflow\",\n  \"project\": {\n      \"id\": \"265740\",\n      \"name\": \"wtt_workflow\"\n  },\n  \"revision\": \"ce2a35ae71a442b6abb3274551fe1692\",\n  \"timezone\": \"UTC\",\n  \"config\": {\n      \"_export\": {\n          \"td\": {\n              \"database\": \"dbname.table\"\n          }\n      },\n      \"schedule\": {\n          \"start\": \"2022-04-27\",\n          \"minutes_interval>\": 30,\n          \"end\": \"2022-04-30\"\n      },\n      \"+task1\": {\n          \"td_load>\": \"my_transfer_unique_id\"\n      },\n      \"+task2\": {\n          \"td_run>\": \"my_saved_query\"\n      }\n  }\n }\n","lang":"json"},"children":[]}]},"headings":[{"value":"Getting Workflow Objects","id":"getting-workflow-objects","depth":1},{"value":"Example of Calling the API with count","id":"example-of-calling-the-api-with-count","depth":2},{"value":"Example Calling the API with last_id","id":"example-calling-the-api-with-last_id","depth":2},{"value":"Example Calling the API with name_pattern","id":"example-calling-the-api-with-name_pattern","depth":2},{"value":"Getting Workflow Objects by ID","id":"getting-workflow-objects-by-id","depth":2}],"frontmatter":{"seo":{"title":"Getting Workflow Objects"}},"lastModified":"2026-06-01T11:27:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/workflows/viewing-start-and-end-dates-using-an-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}