Skip to content

docs: add status message section to Actor lifecycle page#586

Open
TC-MO wants to merge 3 commits intomasterfrom
docs/add-status-message-section
Open

docs: add status message section to Actor lifecycle page#586
TC-MO wants to merge 3 commits intomasterfrom
docs/add-status-message-section

Conversation

@TC-MO
Copy link
Copy Markdown
Contributor

@TC-MO TC-MO commented Apr 14, 2026

I was going through apify-docs issues and noticed apify/apify-docs#400.

This PR adds similar section as is already in Python docs & creates a new codeblock demonstrating the functionality.

TC-MO and others added 2 commits April 14, 2026 11:51
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TC-MO TC-MO self-assigned this Apr 14, 2026
@TC-MO TC-MO added documentation Improvements or additions to documentation. adhoc Ad-hoc unplanned task added during the sprint. t-docs Issues owned by technical writing team. labels Apr 14, 2026
@TC-MO TC-MO requested a review from B4nan April 14, 2026 11:23
Copy link
Copy Markdown
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @TC-MO !

Here are my few first-minute ideas:


[Status messages](/platform/actors/development/programming-interface/status-messages) are lightweight, human-readable progress indicators displayed with the Actor run in the Apify Console (separate from logs). Use them to communicate high-level phases or milestones, such as "Fetching list", "Processed 120/500 pages", or "Uploading results".

Update the status only when the user's understanding of progress changes - avoid frequent updates for every processed item. Detailed information should go to logs or storages (Dataset, Key-value store) instead.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the example code is showing exactly this :)


<CodeBlock language="js">{StatusMessageSource}</CodeBlock>

The SDK only sends an API request when the message text changes, so repeating the same message incurs no additional cost.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK only sends an API request when the message text changes

I don't think this is true. We need to send the request every time, as somebody else might have updated the message in the meantime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this valid also for Python SDK? I based my prose on Python SDK section about Status Messages so it might also be wrong for Python SDK?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so, the code doesn't seem to indicate anything like this.

I see this was added to the Python SDK docs by @vdusek - do you have any idea what this was referring to, Vlada?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, in Python SDK, the set_status_message() calls self.apify_client.run(...).update(status_message=...) every time and the sentence "The SDK only sends an API request when the message text changes" is wrong.

PR fixing it -> apify/apify-sdk-python#859

Comment thread docs/02_concepts/01_actor_lifecycle.mdx Outdated

## Status messages

[Status messages](/platform/actors/development/programming-interface/status-messages) are lightweight, human-readable progress indicators displayed with the Actor run in the Apify Console (separate from logs). Use them to communicate high-level phases or milestones, such as "Fetching list", "Processed 120/500 pages", or "Uploading results".
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(separate from logs)

technically half-true, setting the status message with SDK actually logs the status message.

apify-sdk-js/src/actor.ts

Lines 1095 to 1100 in 2c522d1

const loggedStatusMessage = `[Status message]: ${statusMessage}`;
switch (level) {
case 'DEBUG':
log.debug(loggedStatusMessage);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this valid also for Python SDK? I based my prose on Python SDK section about Status Messages so it might also be wrong for Python SDK?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that Python logs the status message only when running locally, i.e., not on the platform. So it does make a little more sense for Python (it's not really that big of a deal for JS anyway).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I remember discussing this 1-2 years ago. And you are right. The status message should appear in the console with Actor runs, while locally it should be written to the logs (since there's no console to render it, hah).

Copy link
Copy Markdown
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vdusek added a commit to apify/apify-sdk-python that referenced this pull request Apr 16, 2026
- Remove the incorrect claim that the SDK deduplicates status message
API calls (it doesn't — `set_status_message()` always calls the API)
- Replace the misleading "(separate from logs)" note with accurate
behavior: when running locally, the SDK logs the status message instead
of sending it to the platform
- Apply the same fix to the versioned docs snapshot
- Context: flagged during review of apify/apify-sdk-js#586 by @barjin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. documentation Improvements or additions to documentation. t-docs Issues owned by technical writing team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants