{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Journey Orchestration","type":"markdown"},"seo":{"title":"On-Demand Journey Execution","description":"Trigger a batch journey immediately using the most recent segment data, without waiting for a Parent Segment refresh to complete.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"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":"on-demand-journey-execution","__idx":0},"children":["On-Demand Journey Execution"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On-Demand Journey Execution lets you trigger a batch journey immediately, using the most recently completed segment data, without waiting for a Parent Segment refresh to complete."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, a batch journey runs only after its associated Parent Segment refresh finishes. This works well for scheduled daily campaigns but creates delays when you need to act quickly — for example, after updating a segment rule or launching a time-sensitive campaign. On-demand execution removes that dependency."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On-demand execution is available today via the API and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx"]}," CLI. Treasure AI Studio users can trigger a journey using natural language — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#using-treasure-ai-studio"},"children":["Using Treasure AI Studio"]}," below. A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run Now"]}," button in the Treasure AI UI is planned for a future release."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-to-use-it","__idx":1},"children":["When to use it"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You've updated a segment rule and want the journey to execute immediately"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You want to run a journey at a specific time, independent of the data refresh schedule"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You're building an automated pipeline that triggers journeys programmatically"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"before-you-start","__idx":2},"children":["Before you start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify the following before triggering an on-demand run:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Condition"},"children":["Condition"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to do if it's not met"},"children":["What to do if it's not met"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Journey is active (not paused or draft)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Activate the journey from the Treasure AI UI"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Journey has been refreshed at least once"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run a full data refresh first"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No data refresh is currently running"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait for the refresh to complete, then retry"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Journey is not already running"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait for the current execution to finish"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Journey is not part of a Priority Group"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Priority Group journeys are not supported — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#limitations"},"children":["Limitations"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-trigger-a-run","__idx":3},"children":["How to trigger a run"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-treasure-ai-studio","__idx":4},"children":["Using Treasure AI Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure AI Studio can trigger a journey on your behalf using natural language. Provide the journey ID or paste the journey's console URL — Studio will resolve the ID and run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx journey run"]}," in the background."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example prompts:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Run journey 123.\n"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Trigger this journey: https://console.treasuredata.com/app/workflows/journeys/123\n"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Run the Black Friday campaign journey (ID 456) now.\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Studio confirms when the journey has started and returns a session ID you can use to monitor progress."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-the-tdx-cli","__idx":5},"children":["Using the TDX CLI"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"tdx journey run <journey_id>\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"tdx journey run 123\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The command confirms the journey has started and returns a session ID:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Journey execution started.\n\nJourney ID:          123\nWorkflow Session ID: 200\nStatus:              running\n\nMonitor progress:\n  tdx wf sessions 200\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The command exits immediately — it does not wait for the journey to finish."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-the-api","__idx":6},"children":["Using the API"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"POST /entities/journeys/{journeyId}/run\n"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the API base URL for your region. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["Treasure API Endpoints and Base URLs"]}," for the full list."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Include your API key in the request header:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"curl -X POST \\\n  https://api-cdp.treasuredata.com/entities/journeys/123/run \\\n  -H \"Authorization: TD1 <your_api_key>\" \\\n  -H \"Content-Type: application/json\"\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example response:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"id\": \"100\",\n    \"type\": \"execution-journey\",\n    \"attributes\": {\n      \"journeyId\": \"123\",\n      \"workflowSessionId\": \"200\",\n      \"createdAt\": \"2026-05-07T00:00:00+00:00\",\n      \"status\": \"running\"\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["workflowSessionId"]}," to monitor the run in the Treasure AI Workflow console."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-to-expect","__idx":7},"children":["What to expect"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Your audience data is current, but not real-time."]}," The journey uses the data from the last completed Parent Segment refresh. If your refresh runs nightly, an on-demand run at noon uses last night's data. Changes that arrived after the last refresh — new opt-outs, updated profiles — won't be reflected until the next refresh completes."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Segment rule changes take effect immediately."]}," If you've edited a segment rule, that change applies to the next run, including an on-demand run. You don't need to wait for a full data rebuild."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exception:"]}," If you've made structural changes to the Parent Segment configuration — such as adding a new data source, attribute, or behavior definition — those changes require a full refresh before they're reflected in any journey run."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Downstream activations fire normally."]}," Any actions configured to run after the journey completes (emails, exports, CRM updates) will execute just as they would after a scheduled run."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Triggering one version runs all versions."]}," If your journey has multiple versions, triggering the latest version automatically runs older versions in sequence after it completes — the same behavior as a scheduled run."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-reference","__idx":8},"children":["Error reference"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the run doesn't start, the API returns an error with a reason code:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What it means"},"children":["What it means"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to do"},"children":["What to do"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PARENT_SEGMENT_RUNNING"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A data refresh is currently in progress"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait for the refresh to finish, then try again"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JOURNEY_WORKFLOW_RUNNING"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The journey is already running"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait for the current run to complete"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JOURNEY_NOT_ACTIVE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The journey is paused or in draft"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Activate the journey in the Treasure AI UI first"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PRIORITY_GROUP_JOURNEY_NOT_ELIGIBLE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Journey uses Priority Groups"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not supported — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#limitations"},"children":["Limitations"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NOT_LATEST_VERSION"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The journey ID is an older version"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use the latest version's journey ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PARENT_SEGMENT_NEVER_REFRESHED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The audience data has never been built"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run a full data refresh first"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"automating-on-demand-runs","__idx":9},"children":["Automating on-demand runs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can trigger on-demand journey runs from a Treasure Workflow using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http>"]}," operator. This lets you schedule or chain journey execution entirely within Treasure AI — no external scripts or cron jobs required."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example: trigger a journey on demand from a workflow"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"timezone: UTC\n\nschedule:\n  daily>: \"06:00:00\"\n\n+run_journey:\n  http>: https://api-cdp.treasuredata.com/entities/journeys/123/run\n  method: POST\n  content_type: application/json\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store your API key as a workflow secret so it is never hardcoded:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sh","header":{"controls":{"copy":{}}},"source":"tdx wf secrets --set http.authorization=\"TD1 your_api_key_here\" --project your_project_name\n","lang":"sh"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http.authorization"]}," secret is automatically included in every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http>"]}," request in the project as the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Handling conflicts:"]}," If the journey or Parent Segment is already running when the workflow fires, the API returns a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}," error and the workflow attempt fails. Add a retry policy to handle transient conflicts:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"+run_journey:\n  http>: https://api-cdp.treasuredata.com/entities/journeys/123/run\n  method: POST\n  content_type: application/json\n  _retry: 3\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/workflows"},"children":["Treasure Workflow documentation"]}," for full configuration options."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":10},"children":["Limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Priority Group journeys are not supported."]}," Priority Groups require coordinating across multiple journeys during a data refresh — this can't be replicated in a single on-demand run."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Structural data changes need a full rebuild first."]}," If you've added new data sources or changed the structure of your Parent Segment, run a full refresh before triggering an on-demand run."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No UI button yet."]}," The Run Now button is planned for a future release. For now, use Treasure AI Studio, the CLI, or the API."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-pages","__idx":11},"children":["Related pages"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/journey-orchestration/batch/journey-workflow-dependencies"},"children":["Journey Workflow Dependencies"]}," — how Parent Segment, journey, and activation workflows interact by default"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey"},"children":["Creating a Batch Journey"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/journey-orchestration/batch/pausing-and-resuming-a-journey"},"children":["Pausing and Resuming a Journey"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["Treasure API Endpoints and Base URLs"]}]}]}]},"headings":[{"value":"On-Demand Journey Execution","id":"on-demand-journey-execution","depth":1},{"value":"When to use it","id":"when-to-use-it","depth":2},{"value":"Before you start","id":"before-you-start","depth":2},{"value":"How to trigger a run","id":"how-to-trigger-a-run","depth":2},{"value":"Using Treasure AI Studio","id":"using-treasure-ai-studio","depth":3},{"value":"Using the TDX CLI","id":"using-the-tdx-cli","depth":3},{"value":"Using the API","id":"using-the-api","depth":3},{"value":"What to expect","id":"what-to-expect","depth":2},{"value":"Error reference","id":"error-reference","depth":2},{"value":"Automating on-demand runs","id":"automating-on-demand-runs","depth":2},{"value":"Limitations","id":"limitations","depth":2},{"value":"Related pages","id":"related-pages","depth":2}],"frontmatter":{"seo":{"title":"On-Demand Journey Execution","description":"Trigger a batch journey immediately using the most recent segment data, without waiting for a Parent Segment refresh to complete."}},"lastModified":"2026-06-23T23:54:13.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/journey-orchestration/batch/on-demand-journey-execution","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}