Slack のチャンネルやスレッドで Agentforce エージェントをメンションすると、Slack はチャンネル ID とスレッド ts をセッション変数としてエージェントに送信します。ただし、エージェントで変数を宣言していない場合、Salesforce は Slack から送信された値を無視します。この記事では、Agentforce エージェントで変数を宣言し、Flow や Apex のアクションで利用する方法を説明します。
この記事は、Slack から Agentforce エージェントを起動したときに、メンションされたチャンネルの ID とスレッドの ts (タイムスタンプ) をエージェントの実行中に取得したい場合の手順です。Slack から送信される値は、エージェントで変数を宣言すると参照できます。
Slack のチャンネルでエージェントをメンションすると、Slack は次の変数を使ってセッションを開始します。
Slack は、同じセッションの後続のメッセージでも同じ変数を送信します。そのため、同じスレッドで再度エージェントをメンションした場合も、正しい値を参照できます。
Agentforce エージェントで変数を宣言するときは、次の条件を満たす必要があります。
次の手順で、エージェントに変数を宣言し、アクションに値を渡します。
`variables:
slack_channel: mutable string
label: "Slack Channel ID"
description: "The Slack channel the user is talking to the agent in."
visibility: "External"
slack_thread_ts: mutable string
label: "Slack Thread TS"
description: "The ts of the Slack thread the agent is replying in."
visibility: "External"`
変数名を完全一致させ、visibility を External にすることで、Slack から送信される値をエージェントが受け取れるようになります。005466770

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.