The brain exhibits intrinsic dynamics characterized by spontaneous spatiotemporal reorganization of neural activity or metastability, which is associated closely with functional integration and segregation. Compared to dynamic functional connectivity, state-dependent effective connectivity (i.e., dynamic effective connectivity) is more suitable for exploring the metastability as its ability to infer causalities between brain regions. However, methods for state-dependent effective connectivity are scarce and urgently needed. In this study, a novel data-driven computational framework, named NHSMM-MAR-sdNC integrating nonparametric hidden semi-Markov model combined with multivariate autoregressive model and state-dependent new causality, is proposed to investigate the state-dependent effective connectivity. The framework is not constrained by any biological assumptions. Furthermore, state number can be inferred from the observed data directly and the state duration distributions will be estimated explicitly rather than restricted by geometric form, which overcomes limitations of hidden Markov model. Experimental results of synthetic data show that the framework can identify the state number adaptively and the state-dependent causality networks accurately. The dynamics of state-related causality networks are also revealed by the new method on real-world resting-state fMRI data. Our method provides a new data-driven computational framework for identifying state-dependent effective connectivity, which will facilitate the identification and assessment of metastability and itinerant dynamics of the brain.