Temporal

View as MarkdownOpen in Claude

Integrate You.com’s APIs into Temporal workflows as durable activities that survive crashes and automatically resume where they left off.

The youdotcom-temporal package provides six activities covering every You.com API, wrapped in a YouPlugin (a Temporal SimplePlugin) for one-line worker setup:

  1. youdotcom_search for real-time web and news search
  2. youdotcom_answer for synthesized answers with inline citations
  3. youdotcom_research for multi-step research with citations
  4. youdotcom_research_background for long-running background research
  5. youdotcom_finance_research for finance-focused research
  6. youdotcom_contents for webpage content extraction

Every activity returns JSON-serializable dicts, maps SDK errors to Temporal error types with correct retryability, and disables the SDK’s built-in HTTP retries so Temporal is the single retry authority.


Getting Started

1

Install the Package

$pip install youdotcom-temporal
2

Set Your API Key

$export YDC_API_KEY="<YDC_API_KEY>"

Get your API key at you.com/platform.

3

Start a Local Temporal Server

$temporal server start-dev

Usage


Activities

ActivityInputDescription
youdotcom_searchSearchInputWeb and news search results
youdotcom_answerAnswerInputSynthesized answer with inline citations
youdotcom_researchResearchInputMulti-step research with citations
youdotcom_research_backgroundResearchInputLong-running background research (submits, streams, polls until complete)
youdotcom_finance_researchFinanceResearchInputFinance-focused research with citations
youdotcom_contentsContentsInputWebpage content as HTML or markdown

Error Handling

HTTP statusError typeRetryable?
401, 403YouAuthErrorNo
422YouValidationErrorNo
402YouQuotaExhaustedNo
429(passthrough)Yes, Temporal backs off
5xx(passthrough)Yes, Temporal backs off
HTTP timeoutYouTimeoutErrorYes, Temporal backs off

The SDK’s built-in HTTP retries are disabled so Temporal is the single retry authority. Set RetryPolicy on workflow.execute_activity to control backoff and max attempts.


Resources