Uh oh!
There was an error while loading. Please reload this page.
Add create XCom endpoint in RestAPI - #46042
Conversation
Uh oh!
There was an error while loading. Please reload this page.
jscheffl
commented
Jan 26, 2025
Just adding comments as copy of the 1:1 conversation: I would understand if the API can be used to "patch" wrong/incorrect XCom values administratively for specific szenarios where upstream tasks can not be re-executed but values are incorrect. But the PR of this API is only adding XCom, will raise an error if the value is existing. So before merging I'd propose to have a bit of discussion between the other maintainers if we want to open XCom up to external applications to signal a processing status. If so then this integration pattern would require a bit of documentation as well. |
eladkal
commented
Jan 27, 2025
This is not the use case. The use case is incident recovery. When on call fixes problems with data pipeline manual interventions sometimes required. |
jscheffl
commented
Jan 27, 2025
If I read the PR description incident recovery is not the use case. For incident recovery also patching of XCom would be needed. It is called as:
|
eladkal
commented
Jan 27, 2025
@jscheffl The PR is to solve the pain I raised in #45966 @shubhamraj-git I suggest to strike trough the extra use cases mentioned in the description. |
Uh oh!
There was an error while loading. Please reload this page.
jscheffl
commented
Jan 27, 2025
shubhamraj-git
commented
Jan 28, 2025
Yes, I was waiting for discussions to be done. I will include the tests before merging. @jscheffl |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Code looks good to me.
Indeed we need tests before being able to merge it.
Same as Jens on this one, indeed it feels a little weird from a functional point of view, but if this is required for some use case, then I'm fine with it.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
eladkal
commented
Jan 31, 2025
ready to merge? |
shubhamraj-git
commented
Jan 31, 2025
Yes, added the tests and good to merge. |
eladkal
commented
Jan 31, 2025
@pierrejeambrun@jscheffl any further comments? |
jscheffl
commented
Jan 31, 2025
No. No objections. |
pierrejeambrun
commented
Feb 3, 2025
I think we need one last rebase. |
Uh oh!
There was an error while loading. Please reload this page.
* create xcom api * Add tests for create xcom API * Small tweak --------- Co-authored-by: pierrejeambrun <pierrejbrun@gmail.com>
* create xcom api * Add tests for create xcom API * Small tweak --------- Co-authored-by: pierrejeambrun <pierrejbrun@gmail.com>
related: #45966
Update: Modifying the description only for create API and simplifying use case.
The XCom creation API fills a critical gap by enabling dynamic updates to workflows.
Current XComs are tied to task execution, limiting flexibility for long-running workflows.
The API allows dynamic creation of XCom values during execution, This is needed mostly for the use case of fixing manually recover from problems with workflows.
Avoid placeholder tasks just to generate XComs.
We will also have the edit XCom API as part of #45966 coming soon. This PR is only for creation.
Steps to play around the feature.
This Airflow DAG demonstrates how to use XComs for passing data between tasks. The first task (wait_and_not_push) waits for 1 minute but does not push any XCom. The second task (pull_and_print) attempts to pull an XCom value with the key outbound_key1 from the first task, logs it if found, or warns if absent.
Now, check the logs, You can see the XCom pull was successful.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.